Skip to main content

Mojo function

arg_nonzero_shape

arg_nonzero_shape[dtype: DType](input_buffer: TileTensor[dtype, address_space=input_buffer.address_space, linear_idx_type=input_buffer.linear_idx_type, element_size=input_buffer.element_size]) -> IndexList[2]

Return [NumNonZeros, InputRank] where NumNonZeros are the number of non-zero elements in the input.

Parameters:

  • dtype (DType): The element dtype.

Args:

Returns:

IndexList[2]: Shape of the arg_nonzero kernel for this input [NumNonZeros, InputRank].