class_docstr: Equivalent of numpy.ndarray backed by TensorFlow tensors.
  
  This does not support all features of NumPy ndarrays e.g. strides and
  memory order since, unlike NumPy, the backing storage is not a raw memory
  buffer.
  
  TODO(srbs): Clearly specify which attributes and methods are not supported
  or if there are any differences in behavior.
docstr: Returns a python scalar.
  
  This allows using an instance of this class as an array index.
  Note that only arrays of integer types with size 1 can be used as array
  indices.
  
  Returns:
    A Python scalar.
  
  Raises:
    TypeError: If the array is not of an integer type.
    ValueError: If the array does not have size 1.
docstr_tok: ["Returns","a","python","scalar",".","This","allows","using","an","instance","of","this","class","as","an","array","index",".","Note","that","only","arrays","of","integer","types","with","size","1","can","be","used","as","array","indices",".","Returns",":","A","Python","scalar",".","Raises",":","TypeError",":","If","the","array","is","not","of","an","integer","type",".","ValueError",":","If","the","array","does","not","have","size","1","."]
code: def __index__(self):
      """Returns a python scalar.
  
      This allows using an instance of this class as an array index.
      Note that only arrays of integer types with size 1 can be used as array
      indices.
  
      Returns:
        A Python scalar.
  
      Raises:
        TypeError: If the array is not of an integer type.
        ValueError: If the array does not have size 1.
      """
      # TODO(wangpeng): Handle graph mode
      return self.data.numpy().item()
  
imports: import numpy
  import six
  import tensorflow.compat.v2
  from trax.tf_numpy.numpy_impl import dtypes
label_desc: Use image node_id 19 for calling the ndarray obj's underlying member method code with example usage: obj.__index__() and returns: self