parameters: (m, v)
return_statement: return v
docstring: Add NextIteration and back edge from v to m.
docstring_summary: Add NextIteration and back edge from v to m.
docstring_tokens: Add NextIteration and back edge from v to m .
function: def _AddNextAndBackEdge(m, v):
    """Add NextIteration and back edge from v to m."""
    if isinstance(m, ops.Tensor):
      v = ops.convert_to_tensor(v)
      v = _NextIteration(v)
      m.op._update_input(1, v)   # pylint: disable=protected-access
    elif isinstance(m, ops.IndexedSlices):
      # pylint: disable=protected-access
      v = math_ops._as_indexed_slices(v)
      v = _NextIteration(v)
      m.values.op._update_input(1, v.values)
      m.indices.op._update_input(1, v.indices)
      # pylint: enable=protected-access
      if m.dense_shape is not None:
        if v.dense_shape is None:
          raise ValueError("Must have dense shape: %s" % v.name)
        m.dense_shape.op._update_input(1, v.dense_shape)
    elif isinstance(m, ops.SparseTensor):
      if not isinstance(v, ops.SparseTensor):
        raise ValueError("Must be a sparse tensor: %s" % v.name)
      v = _NextIteration(v)
      # pylint: disable=protected-access
      m.values.op._update_input(1, v.values)
      m.indices.op._update_input(1, v.indices)
      m.shape.op._update_input(1, v.shape)
      # pylint: enable=protected-access
    else:
      raise TypeError("Type %s not supported" % type(m))
    return v
function_tokens: def _AddNextAndBackEdge ( m , v ) : if isinstance ( m , ops . Tensor ) : v = ops . convert_to_tensor ( v ) v = _NextIteration ( v ) m . op . _update_input ( 1 , v ) # pylint: disable=protected-access elif isinstance ( m , ops . IndexedSlices ) : # pylint: disable=protected-access v = math_ops . _as_indexed_slices ( v ) v = _NextIteration ( v ) m . values . op . _update_input ( 1 , v . values ) m . indices . op . _update_input ( 1 , v . indices ) # pylint: enable=protected-access if m . dense_shape is not None : if v . dense_shape is None : raise ValueError ( "Must have dense shape: %s" % v . name ) m . dense_shape . op . _update_input ( 1 , v . dense_shape ) elif isinstance ( m , ops . SparseTensor ) : if not isinstance ( v , ops . SparseTensor ) : raise ValueError ( "Must be a sparse tensor: %s" % v . name ) v = _NextIteration ( v ) # pylint: disable=protected-access m . values . op . _update_input ( 1 , v . values ) m . indices . op . _update_input ( 1 , v . indices ) m . shape . op . _update_input ( 1 , v . shape ) # pylint: enable=protected-access else : raise TypeError ( "Type %s not supported" % type ( m ) ) return v