class_docstr: An object use to hold the sharding policy for a Tensor.
class_docstr_tok: ["An","object","use","to","hold","the","sharding","policy","for","a","Tensor","."]
docstr: Returns the shape of an unpartitioned Tensor.
  
  When given the shape of a 'sharded-size' Tensor, returns the shape
  of the full shape of its unpartitioned Tensor.
  
  Args:
    shape: The shape of the sharded Tensor.
  
  Returns:
    The shape of the unpartitioned version of the Tensor.
  
  Raises:
    ValueError: if shape has unknown sharded dimension
docstr_tok: ["Returns","the","shape","of","an","unpartitioned","Tensor",".","When","given","the","shape","of","a","'sharded-size","'","Tensor",",","returns","the","shape","of","the","full","shape","of","its","unpartitioned","Tensor",".","Args",":","shape",":","The","shape","of","the","sharded","Tensor",".","Returns",":","The","shape","of","the","unpartitioned","version","of","the","Tensor",".","Raises",":","ValueError",":","if","shape","has","unknown","sharded","dimension"]
code: def get_unpartitioned_shape(self, shape):
      """Returns the shape of an unpartitioned Tensor.
  
      When given the shape of a 'sharded-size' Tensor, returns the shape
      of the full shape of its unpartitioned Tensor.
  
      Args:
        shape: The shape of the sharded Tensor.
  
      Returns:
        The shape of the unpartitioned version of the Tensor.
  
      Raises:
        ValueError: if shape has unknown sharded dimension
      """
      shape = tensor_shape.as_shape(shape)
      dims = shape.as_list()
      if (
          self._shard_dimension is None
          or self._number_of_partitions is None
          or not dims
      ):
          return None
      if dims[self._shard_dimension] is None:
          raise ValueError(
              f"Shape {shape.as_list()} must have a fixed size for "
              f"dimension {self._shard_dimension} that is known. "
          )
      if self._number_of_partitions > 1:
          dims[self._shard_dimension] *= self._number_of_partitions
      return tensor_shape.as_shape(dims)
  
file_path: tensorflow-upstream/tensorflow/python/tpu/tpu_sharding.py
imports: from tensorflow.python.framework import tensor_shape
label_desc: Use image node_id 12 for calling the ShardingPolicy obj's underlying member method code with example usage: obj.get_unpartitioned_shape(shape) and returns: tensor_shape, None