Skip to main content

Mojo function

arg_nonzero_shape

arg_nonzero_shape[dtype: DType](input_buffer: TileTensor[dtype, input_buffer.LayoutType, input_buffer.origin, 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:

  • input_buffer (TileTensor): The tensor to count the non-zeros in.

Returns:

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

Was this page helpful?