Function burn::tensor::argwhere_data

pub fn argwhere_data<B>(
    data: TensorData,
    device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
where B: Backend,
Expand description

Compute the indices of the elements that are non-zero, grouped by element.

§Arguments

  • data - The input tensor data.

§Returns

A 2D tensor containing the indices of all non-zero elements of the given tensor. Each row contains the indices of a non-zero element.

§Remarks

This is a fallback solution that used only when the backend doesn’t have the corresponding implementation. Ideally, it is supposed to be implemented by the backend and the backend implementation will be resolved by static dispatch. It is not designed for direct usage by users, and not recommended to import or use this function directly.