def METHOD_NAME(t, shape):  # pylint: disable=redefined-outer-name
  """Reshape composite tensor `t` to `shape`.
  Args:
    t: A `Tensor` or `SparseTensor`.
    shape: `1D` tensor, array, or list.  The new shape.
  Returns:
    The reshaped tensor.
  """
  return (
      tf.sparse.METHOD_NAME(t, shape)
      if isinstance(t, tf.SparseTensor)
      else tf.METHOD_NAME(t, shape)
  )