Applies an inplace sub on input x at index i with value v. Note that this function is not actually inplace - it allocates a copy of x. The utility is not avoiding memory copies but rather specifying a sparse update. If i is None, x and v must be the same shape. Computes y = x; y -= v;
(x, i, v)
| 226 | ('Prefer tf.tensor_scatter_nd_sub, which offers the same functionality ' |
| 227 | 'with well-defined read-write semantics.')) |
| 228 | def inplace_sub(x, i, v): |
| 229 | """Applies an inplace sub on input x at index i with value v. |
| 230 | |
| 231 | Note that this function is not actually inplace - it allocates |
| 232 | a copy of x. The utility is not avoiding memory copies but rather |
| 233 | specifying a sparse update. |
| 234 | |
| 235 | If i is None, x and v must be the same shape. Computes |
| 236 | y = x; y -= v; |
| 237 | If i is a scalar, x has a rank 1 higher than v's. Computes |
| 238 | y = x; y[i, :] -= v; |
| 239 | Otherwise, x and v must have the same rank. Computes |
| 240 | y = x; y[i, :] -= v; |
| 241 | |
| 242 | Args: |
| 243 | x: A Tensor. |
| 244 | i: None, a scalar or a vector. |
| 245 | v: A Tensor. |
| 246 | |
| 247 | Returns: |
| 248 | Returns y, which is guaranteed not to be an alias of x. |
| 249 | |
| 250 | """ |
| 251 | return alias_inplace_sub(gen_array_ops.deep_copy(x), i, v) |
| 252 | |
| 253 | empty = gen_array_ops.empty |
nothing calls this directly
no test coverage detected