Mojo function
arg_nonzero
arg_nonzero[dtype: DType, output_type: 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], output_buffer: TileTensor[output_type, output_buffer.LayoutType, output_buffer.origin, address_space=output_buffer.address_space, linear_idx_type=output_buffer.linear_idx_type, element_size=output_buffer.element_size])
Gather the indices of all non-zero elements in input buffer storing the indices in the output_buffer.
Parameters:
- βdtype (
DType): The element dtype. - βoutput_type (
DType): The integer dtype to store the indices in.
Args:
- βinput_buffer (
TileTensor): The tensor to count the non-zeros in. - βoutput_buffer (
TileTensor): The indices of all non-zero elements.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!