Creates a new tf.Variable and a new tf.Operation that assigns the value of the tensor to this variable. Args: tensor: tensor whose values will be stored in a new tf.Variable. Returns: An assignment operation.
(self, tensor)
| 514 | return state_ops.scatter_update(cache, indices, updates).op |
| 515 | |
| 516 | def _snapshot_tensor(self, tensor): |
| 517 | """Creates a new tf.Variable and a new tf.Operation that assigns the value of the tensor to this variable. |
| 518 | |
| 519 | Args: |
| 520 | tensor: tensor whose values will be stored in a new tf.Variable. |
| 521 | Returns: |
| 522 | An assignment operation. |
| 523 | """ |
| 524 | |
| 525 | snapshot_variable = self._create_or_get_tensor_values_cache( |
| 526 | tensor.name, tensor.op.graph, |
| 527 | tensor.shape.as_list(), tensor.dtype) |
| 528 | return state_ops.assign(snapshot_variable, tensor).op |
| 529 | |
| 530 | def _preprocess_traced_tensor(self, tensor): |
| 531 | """Computes NAN/Norm/Max on TPUs before sending to CPU. |
no test coverage detected