MCPcopy Create free account
hub / github.com/apache/singa / ctensor2numpy

Function ctensor2numpy

python/singa/autograd.py:1363–1369  ·  view source on GitHub ↗

To be used in SoftMax Operator. Convert a singa_tensor to numpy_tensor.

(x)

Source from the content-addressed store, hash-verified

1361
1362
1363def 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
1372class Flatten(Operator):

Callers

nothing calls this directly

Calls 3

shapeMethod · 0.80
SizeMethod · 0.45
reshapeMethod · 0.45

Tested by

no test coverage detected