ToTensor returns the Tensor referenced by th. It may block if this tensor is not yet computed.
()
| 144 | // ToTensor returns the Tensor referenced by th. It may block if this tensor is |
| 145 | // not yet computed. |
| 146 | func (th *TensorHandle) ToTensor() (*Tensor, error) { |
| 147 | status := newStatus() |
| 148 | cTensor := C.TFE_TensorHandleResolve(th.c, status.c) |
| 149 | if err := status.Err(); err != nil { |
| 150 | return nil, err |
| 151 | } |
| 152 | return newTensorFromC(cTensor), nil |
| 153 | } |
| 154 | |
| 155 | // CopyToDevice creates a new TensorHandle with the same contents as this |
| 156 | // TensorHandle but placed in the memory of the device 'deviceName'. If source |