parameters: (input, dtype=None, name=None)
docstring: Replace every object with a zero.
  
    Example:
    >>> st = StructuredTensor.from_pyval([{"x":[3]}, {"x":[4,5]}])
    >>> tf.ones_like(st)
    <tf.Tensor: shape=(2,), dtype=int32, numpy=array([1.0, 1.0], dtype=float32)>
    >>> st = StructuredTensor.from_pyval([[{"x":[3]}], [{"x":[4,5]}, {"x":[]}]])
    >>> tf.ones_like(st, dtype=tf.int32)
    <tf.RaggedTensor [[1], [1, 1]]>
  
    Args:
      input: a structured tensor.
      dtype: the dtype of the resulting zeros. (default is tf.float32)
      name: a name for the op.
    Returns:
      a tensor of zeros of the same shape.
docstring_summary: Replace every object with a zero.
docstring_tokens: Replace every object with a zero .
function: def ones_like_v2(input, dtype=None, name=None):  # pylint: disable=redefined-builtin
    """Replace every object with a zero.
  
    Example:
    >>> st = StructuredTensor.from_pyval([{"x":[3]}, {"x":[4,5]}])
    >>> tf.ones_like(st)
    <tf.Tensor: shape=(2,), dtype=int32, numpy=array([1.0, 1.0], dtype=float32)>
    >>> st = StructuredTensor.from_pyval([[{"x":[3]}], [{"x":[4,5]}, {"x":[]}]])
    >>> tf.ones_like(st, dtype=tf.int32)
    <tf.RaggedTensor [[1], [1, 1]]>
  
    Args:
      input: a structured tensor.
      dtype: the dtype of the resulting zeros. (default is tf.float32)
      name: a name for the op.
    Returns:
      a tensor of zeros of the same shape.
    """
    if dtype is None:
      dtype = dtypes.float32
    with ops.name_scope(name, 'ones_like', [input]) as name:
      if not input._row_partitions:
        if input._nrows is not None:
          return array_ops.ones([input._nrows], dtype)  # vector.
        else:
          return array_ops.ones([], dtype)  # scalar.
      # 2D and up.
      last_row_partition = input._row_partitions[-1]
  
      result = ragged_tensor.RaggedTensor._from_nested_row_partitions(
          array_ops.ones(last_row_partition.nvals(), dtype=dtype),
          input._row_partitions)
      return result
function_tokens: def ones_like_v2 ( input , dtype = None , name = None ) : # pylint: disable=redefined-builtin if dtype is None : dtype = dtypes . float32 with ops . name_scope ( name , 'ones_like' , [ input ] ) as name : if not input . _row_partitions : if input . _nrows is not None : return array_ops . ones ( [ input . _nrows ] , dtype ) # vector. else : return array_ops . ones ( [ ] , dtype ) # scalar. # 2D and up. last_row_partition = input . _row_partitions [ - 1 ] result = ragged_tensor . RaggedTensor . _from_nested_row_partitions ( array_ops . ones ( last_row_partition . nvals ( ) , dtype = dtype ) , input . _row_partitions ) return result