class_docstr: VarLenTensorValue encapsulates a batch of varlen dense tensor values.
  
  Attributes:
    values: A np.ndarray of values.
    indices: A np.ndarray of indices.
    dense_shape: A np.ndarray representing the dense shape of the entire tensor.
      Note that each row (i.e. set of values sharing the same value for the
      first / batch dimension) is considered to have its own shape based on the
      presence of values.
class_docstr_tok: ["VarLenTensorValue","encapsulates","a","batch","of","varlen","dense","tensor","values",".","Attributes",":","values",":","A","np.ndarray","of","values",".","indices",":","A","np.ndarray","of","indices",".","dense_shape",":","A","np.ndarray","representing","the","dense","shape","of","the","entire","tensor",".","Note","that","each","row","(","i.e",".","set","of","values","sharing","the","same","value","for","the","first","\/","batch","dimension",")","is","considered","to","have","its","own","shape","based","on","the","presence","of","values","."]
code: def __new__(
      cls,
      values: np.ndarray,
      indices: np.ndarray,
      dense_shape: np.ndarray,
  ):
      # we keep the sparse representation despite not needing it so that we can
      # convert back to TF sparse tensors for free.
      if len(dense_shape) != 2:
          raise ValueError(
              "A VarLenTensorValue can only be used to represent a "
              "2D tensor in which the size of the second dimension "
              "varies over rows. However, the provided dense_shape "
              f"({dense_shape}) implies a {dense_shape.size}D tensor"
          )
      row_index_diffs = np.diff(indices[:, 0])
      column_index_diffs = np.diff(indices[:, 1])
      # Enforce row-major ordering of indices by checking that row indices are
      # always increasing, and column indices within the same row are also always
      # increasing.
      bad_index_mask = (row_index_diffs < 0) | (
          (row_index_diffs == 0) & (column_index_diffs < 0)
      )
      if np.any(bad_index_mask):
          raise ValueError(
              "The values and indices arrays must be provided in a "
              "row major order, and represent a set of variable "
              "length dense lists. However, indices["
              f"{np.nonzero(bad_index_mask)[0] + 1}, :] did not "
              "follow this pattern. The full indices array was: "
              f"{indices}."
          )
      return super().__new__(
          cls, values=values, indices=indices, dense_shape=dense_shape
      )
  
imports: import abc
  import datetime
  import operator
  from typing import Any, Callable, Dict, Iterable, List, MutableMapping, NamedTuple, Optional, TypeVar, Tuple, Union
  from apache_beam.utils import shared
  import numpy
  import six
  import tensorflow
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
label_desc: Use image node_id 1 for calling the VarLenTensorValue obj's underlying member method code with example usage: obj.__new__(cls, values, indices, dense_shape) and returns: super