---
title: "hashTensor"
sidebar_label: "hashTensor"
description: "Kotlin binding reference: hashTensor."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[hashTensor](hashTensor.md)

# hashTensor

[common]\
fun [hashTensor](hashTensor.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, mode: [HashTensorMode](../HashTensorMode/index.md) = HashTensorMode.XOR_SUM): [Tensor](../Tensor/index.md)

`hashTensor(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, mode: HashTensorMode = HashTensorMode.XOR_SUM)`: the `hash_tensor` operator. Bitwise hash-reduction over `dims` (empty = all): each element's bits are mixed and combined per `mode` into a UInt64 digest, standard reduction shape. Order-independent under `HashTensorMode::XorSum`, and identical on every backend, a cheap whole-tensor fingerprint for parity checks and cache keys.