parameters: (self, x)
return_statement: return sample_shape, static_sample_shape
docstring: Computes graph and static `sample_shape`.
docstring_summary: Computes graph and static `sample_shape`.
docstring_tokens: Computes graph and static sample_shape .
function: def _sample_shape(self, x):
      """Computes graph and static `sample_shape`."""
      x_ndims = (array_ops.rank(x) if x.shape.ndims is None else x.shape.ndims)
      event_ndims = (array_ops.size(self.event_shape_tensor())
                     if self.event_shape.ndims is None
                     else self.event_shape.ndims)
      batch_ndims = (
          array_ops.size(self._batch_shape_unexpanded)
          if self.batch_shape.ndims is None else self.batch_shape.ndims)
      sample_ndims = x_ndims - batch_ndims - event_ndims
      if isinstance(sample_ndims, int):
        static_sample_shape = x.shape[:sample_ndims]
      else:
        static_sample_shape = tensor_shape.TensorShape(None)
      if static_sample_shape.is_fully_defined():
        sample_shape = np.int32(static_sample_shape.as_list())
      else:
        sample_shape = array_ops.shape(x)[:sample_ndims]
      return sample_shape, static_sample_shape
function_tokens: def _sample_shape ( self , x ) : x_ndims = ( array_ops . rank ( x ) if x . shape . ndims is None else x . shape . ndims ) event_ndims = ( array_ops . size ( self . event_shape_tensor ( ) ) if self . event_shape . ndims is None else self . event_shape . ndims ) batch_ndims = ( array_ops . size ( self . _batch_shape_unexpanded ) if self . batch_shape . ndims is None else self . batch_shape . ndims ) sample_ndims = x_ndims - batch_ndims - event_ndims if isinstance ( sample_ndims , int ) : static_sample_shape = x . shape [ : sample_ndims ] else : static_sample_shape = tensor_shape . TensorShape ( None ) if static_sample_shape . is_fully_defined ( ) : sample_shape = np . int32 ( static_sample_shape . as_list ( ) ) else : sample_shape = array_ops . shape ( x ) [ : sample_ndims ] return sample_shape , static_sample_shape