class_docstr: Represents a sparse tensor.
  
  TensorFlow represents a sparse tensor as three separate dense tensors:
  `indices`, `values`, and `dense_shape`.  In Python, the three tensors are
  collected into a `SparseTensor` class for ease of use.  If you have separate
  `indices`, `values`, and `dense_shape` tensors, wrap them in a `SparseTensor`
  object before passing to the ops below.
  
  Concretely, the sparse tensor `SparseTensor(indices, values, dense_shape)`
  comprises the following components, where `N` and `ndims` are the number
  of values and number of dimensions in the `SparseTensor`, respectively:
  
  * `indices`: A 2-D int64 tensor of shape `[N, ndims]`, which specifies the
    indices of the elements in the sparse tensor that contain nonzero values
    (elements are zero-indexed). For example, `indices=[[1,3], [2,4]]` specifies
    that the elements with indexes of [1,3] and [2,4] have nonzero values.
  
  * `values`: A 1-D tensor of any type and shape `[N]`, which supplies the
    values for each element in `indices`. For example, given `indices=[[1,3],
    [2,4]]`, the parameter `values=[18, 3.6]` specifies that element [1,3] of
    the sparse tensor has a value of 18, and element [2,4] of the tensor has a
    value of 3.6.
  
  * `dense_shape`: A 1-D int64 tensor of shape `[ndims]`, which specifies the
    dense_shape of the sparse tensor. Takes a list indicating the number of
    elements in each dimension. For example, `dense_shape=[3,6]` specifies a
    two-dimensional 3x6 tensor, `dense_shape=[2,3,4]` specifies a
    three-dimensional 2x3x4 tensor, and `dense_shape=[9]` specifies a
    one-dimensional tensor with 9 elements.
  
  The corresponding dense tensor satisfies:
  
  ```python
  dense.shape = dense_shape
  dense[tuple(indices[i])] = values[i]
  ```
  
  By convention, `indices` should be sorted in row-major order (or equivalently
  lexicographic order on the tuples `indices[i]`). This is not enforced when
  `SparseTensor` objects are constructed, but most ops assume correct ordering.
  If the ordering of sparse tensor `st` is wrong, a fixed version can be
  obtained by calling `tf.sparse.reorder(st)`.
  
  Example: The sparse tensor
  
  ```python
  SparseTensor(indices=[[0, 0], [1, 2]], values=[1, 2], dense_shape=[3, 4])
  ```
  
  represents the dense tensor
  
  ```python
  [[1, 0, 0, 0]
   [0, 0, 2, 0]
   [0, 0, 0, 0]]
  ```
class_docstr_tok: ["Represents","a","sparse","tensor",".","TensorFlow","represents","a","sparse","tensor","as","three","separate","dense","tensors",":","`","indices","`",",","`","values","`",",","and","`","dense_shape","`",".","In","Python",",","the","three","tensors","are","collected","into","a","`","SparseTensor","`","class","for","ease","of","use",".","If","you","have","separate","`","indices","`",",","`","values","`",",","and","`","dense_shape","`","tensors",",","wrap","them","in","a","`","SparseTensor","`","object","before","passing","to","the","ops","below",".","Concretely",",","the","sparse","tensor","`","SparseTensor","(","indices",",","values",",","dense_shape",")","`","comprises","the","following","components",",","where","`","N","`","and","`","ndims","`","are","the","number","of","values","and","number","of","dimensions","in","the","`","SparseTensor","`",",","respectively",":","*","`","indices","`",":","A","2-D","int64","tensor","of","shape","`","[","N",",","ndims","]","`",",","which","specifies","the","indices","of","the","elements","in","the","sparse","tensor","that","contain","nonzero","values","(","elements","are","zero-indexed",")",".","For","example",",","`","indices=","[","[","1,3","]",",","[","2,4","]","]","`","specifies","that","the","elements","with","indexes","of","[","1,3","]","and","[","2,4","]","have","nonzero","values",".","*","`","values","`",":","A","1-D","tensor","of","any","type","and","shape","`","[","N","]","`",",","which","supplies","the","values","for","each","element","in","`","indices","`",".","For","example",",","given","`","indices=","[","[","1,3","]",",","[","2,4","]","]","`",",","the","parameter","`","values=","[","18",",","3.6","]","`","specifies","that","element","[","1,3","]","of","the","sparse","tensor","has","a","value","of","18",",","and","element","[","2,4","]","of","the","tensor","has","a","value","of","3.6",".","*","`","dense_shape","`",":","A","1-D","int64","tensor","of","shape","`","[","ndims","]","`",",","which","specifies","the","dense_shape","of","the","sparse","tensor",".","Takes","a","list","indicating","the","number","of","elements","in","each","dimension",".","For","example",",","`","dense_shape=","[","3,6","]","`","specifies","a","two-dimensional","3x6","tensor",",","`","dense_shape=","[","2,3,4","]","`","specifies","a","three-dimensional","2x3x4","tensor",",","and","`","dense_shape=","[","9","]","`","specifies","a","one-dimensional","tensor","with","9","elements",".","The","corresponding","dense","tensor","satisfies",":","``","`","python","dense.shape","=","dense_shape","dense","[","tuple","(","indices","[","i","]",")","]","=","values","[","i","]","``","`","By","convention",",","`","indices","`","should","be","sorted","in","row-major","order","(","or","equivalently","lexicographic","order","on","the","tuples","`","indices","[","i","]","`",")",".","This","is","not","enforced","when","`","SparseTensor","`","objects","are","constructed",",","but","most","ops","assume","correct","ordering",".","If","the","ordering","of","sparse","tensor","`","st","`","is","wrong",",","a","fixed","version","can","be","obtained","by","calling","`","tf.sparse.reorder","(","st",")","`",".","Example",":","The","sparse","tensor","``","`","python","SparseTensor","(","indices=","[","[","0",",","0","]",",","[","1",",","2","]","]",",","values=","[","1",",","2","]",",","dense_shape=","[","3",",","4","]",")","``","`","represents","the","dense","tensor","``","`","python","[","[","1",",","0",",","0",",","0","]","[","0",",","0",",","2",",","0","]","[","0",",","0",",","0",",","0","]","]","``","`"]
docstr: Returns a numpy `array` with the values for this `SparseTensor`.
  
  Requires that this `SparseTensor` was constructed in eager execution mode.
docstr_tok: ["Returns","a","numpy","`","array","`","with","the","values","for","this","`","SparseTensor","`",".","Requires","that","this","`","SparseTensor","`","was","constructed","in","eager","execution","mode","."]
code: def _numpy(self):
      """Returns a numpy `array` with the values for this `SparseTensor`.
  
      Requires that this `SparseTensor` was constructed in eager execution mode.
      """
      if not self._is_eager():
          raise ValueError(
              "SparseTensor.numpy() is only supported in eager mode."
          )
      arr = np.zeros(
          self.dense_shape, dtype=self.dtype.as_numpy_dtype()
      )
      for i, v in zip(self.indices, self.values):
          arr[tuple(i)] = v
  
      return arr
  
imports: import collections
  import numpy
  from tensorflow.core.protobuf import struct_pb2
  from tensorflow.python import pywrap_tensorflow
  from tensorflow.python import tf2
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import override_binary_operator
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework import type_spec
  from tensorflow.python.framework import type_spec_registry
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import gen_sparse_ops
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.types import internal
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 19 for calling the SparseTensor obj's underlying member method code with example usage: obj._numpy() and returns: arr