parameters: (shape, name)
return_statement: return (ops.convert_to_tensor(shape, dtype=dtypes.int64, name=name), rank)
docstring: Returns a tuple of (Tensor or None, rank or None).
docstring_summary: Returns a tuple of (Tensor or None, rank or None).
docstring_tokens: Returns a tuple of ( Tensor or None rank or None ) .
function: def _normalize_sparse_shape(shape, name):
    """Returns a tuple of (Tensor or None, rank or None)."""
    if shape is None:
      return (None, None)
    rank = shape.get_shape()[0] if isinstance(shape, ops.Tensor) else len(shape)
    if not isinstance(shape, ops.Tensor) and None in shape:
      return (None, rank)
    return (ops.convert_to_tensor(shape, dtype=dtypes.int64, name=name), rank)
function_tokens: def _normalize_sparse_shape ( shape , name ) : if shape is None : return ( None , None ) rank = shape . get_shape ( ) [ 0 ] if isinstance ( shape , ops . Tensor ) else len ( shape ) if not isinstance ( shape , ops . Tensor ) and None in shape : return ( None , rank ) return ( ops . convert_to_tensor ( shape , dtype = dtypes . int64 , name = name ) , rank )