asIndices

fun <T : DType, V> Tensor<T, V>.asIndices(strict: Boolean = true): IndexTensor<V>(source)

Validates this tensor as an index tensor and wraps it into IndexTensor.

  • For integer storage dtypes, this is a no-op wrap.

  • For float storage dtypes, checks all elements are mathematically integral when strict is true.