MCPcopy Create free account
hub / github.com/pytorch/pytorch / flatten_ref

Method flatten_ref

caffe2/python/operator_test/flatten_op_test.py:24–28  ·  view source on GitHub ↗
(X)

Source from the content-addressed store, hash-verified

22 axis=axis)
23
24 def flatten_ref(X):
25 shape = X.shape
26 outer = np.prod(shape[:axis]).astype(int)
27 inner = np.prod(shape[axis:]).astype(int)
28 return np.copy(X).reshape(outer, inner),
29
30 self.assertReferenceChecks(gc, op, [X], flatten_ref)
31

Callers

nothing calls this directly

Calls 4

astypeMethod · 0.80
prodMethod · 0.45
reshapeMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected