-------- Methods returning *Tensor Structs that embed *Tensor should ""override"" them Returning their own type -------- Clone returns a copy of the current tensor in a new scope Clone is used to create a different tensor from the output of an operation. The new node is placed at the same level of t
()
| 95 | // The new node is placed at the same level of the current tensor |
| 96 | // it can be seen as a twin tensor |
| 97 | func (tensor *Tensor) Clone() *Tensor { |
| 98 | defer tensor.Check() |
| 99 | scope := NewScope(tensor.Root) |
| 100 | return NewTensor(scope, tensor.Output) |
| 101 | } |
| 102 | |
| 103 | // Cast casts the current tensor to the requested dtype |
| 104 | func (tensor *Tensor) Cast(dtype tf.DataType) *Tensor { |