MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / alias_inplace_sub

Function alias_inplace_sub

tensorflow/python/ops/inplace_ops.py:123–142  ·  view source on GitHub ↗

Applies an inplace sub on input x at index i with value v. Aliases x. If i is None, x and v must be the same shape. Computes x -= v; If i is a scalar, x has a rank 1 higher than v's. Computes x[i, :] -= v; Otherwise, x and v must have the same rank. Computes x[i, :] -= v; Args:

(x, i, v)

Source from the content-addressed store, hash-verified

121 ('Prefer tf.tensor_scatter_nd_sub, which offers the same functionality '
122 'with well-defined read-write semantics.'))
123def alias_inplace_sub(x, i, v):
124 """Applies an inplace sub on input x at index i with value v. Aliases x.
125
126 If i is None, x and v must be the same shape. Computes
127 x -= v;
128 If i is a scalar, x has a rank 1 higher than v's. Computes
129 x[i, :] -= v;
130 Otherwise, x and v must have the same rank. Computes
131 x[i, :] -= v;
132
133 Args:
134 x: A Tensor.
135 i: None, a scalar or a vector.
136 v: A Tensor.
137
138 Returns:
139 Returns x.
140
141 """
142 return _inplace_helper(x, i, v, gen_array_ops.inplace_sub)
143
144
145def empty_like(x, init=None):

Callers 1

inplace_subFunction · 0.85

Calls 1

_inplace_helperFunction · 0.85

Tested by

no test coverage detected