To be used in SoftMax Operator. Convert a singa_tensor to numpy_tensor.
(x)
| 1361 | |
| 1362 | |
| 1363 | def ctensor2numpy(x): |
| 1364 | """ |
| 1365 | To be used in SoftMax Operator. |
| 1366 | Convert a singa_tensor to numpy_tensor. |
| 1367 | """ |
| 1368 | np_array = x.GetFloatValue(int(x.Size())) |
| 1369 | return np_array.reshape(x.shape()) |
| 1370 | |
| 1371 | |
| 1372 | class Flatten(Operator): |