MCPcopy Create free account
hub / github.com/Xilinx/CHaiDNN / flattenTensorDim

Function flattenTensorDim

software/xtract/xi_funcs.cpp:51–62  ·  view source on GitHub ↗

Dimension --> <1, 1, 1, A*B*C*D>

Source from the content-addressed store, hash-verified

49
50// Dimension <A, B, C, D> --> <1, 1, 1, A*B*C*D>
51vector<int> flattenTensorDim (vector<int>& src)
52{
53 int finalDim = 1;
54 for(int i=0; i<src.size(); i++)
55 {
56 finalDim *= src.at(i);
57 }
58
59 vector<int> dst(4, 1); // 1x1x1x1
60 dst.at(3) = finalDim; // 1x1x1xfinalDim
61 return dst;
62}
63
64// Get total number of elems in a blob
65int getSize(vector<int>& src)

Callers 1

ExtractFCParametersFunction · 0.85

Calls 2

sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected