Skip to main content

Mojo function

arg_nonzero_shape

arg_nonzero_shape[dtype: DType, single_thread_blocking_override: Bool](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.
  • โ€‹single_thread_blocking_override (Bool): This op can block.

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?