parameters: (x)
return_statement: return x
docstring: r'''
      Return the index of the elements of input tensor which are not equal to zero.
docstring_summary: r'''
      Return the index of the elements of input tensor which are not equal to zero.
docstring_tokens: r Return the index of the elements of input tensor which are not equal to zero .
function: def nonzero(x):
      r'''
      Return the index of the elements of input tensor which are not equal to zero.
      '''
      x = jt.where(x)
      x = [xx.unsqueeze(1) for xx in x]
      if len(x)<2:
          return x[0]
      x = jt.contrib.concat(x,dim=1)
      return x
function_tokens: def nonzero ( x ) : x = jt . where ( x ) x = [ xx . unsqueeze ( 1 ) for xx in x ] if len ( x ) < 2 : return x [ 0 ] x = jt . contrib . concat ( x , dim = 1 ) return x