MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / modDims

Function modDims

src/backend/common/moddims.cpp:64–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63template<typename T>
64Array<T> modDims(const Array<T> &in, const af::dim4 &newDims) {
65 if (in.isLinear() == false) {
66 // Nonlinear array's shape cannot be modified. Copy the data and modify
67 // the shape of the array
68 Array<T> out = copyArray<T>(in);
69 out.setDataDims(newDims);
70 return out;
71 } else if (in.isReady()) {
72 /// If the array is a buffer, modify the dimension and return
73 auto out = in;
74 out.setDataDims(newDims);
75 return out;
76 } else {
77 /// If the array is a node and not linear and not a buffer, then create
78 /// a moddims node
79 auto out = moddimOp<T>(in, newDims);
80 return out;
81 }
82}
83
84template<typename T>
85detail::Array<T> flat(const detail::Array<T> &in) {

Callers 15

sparseConvertDenseToCOOFunction · 0.50
convolve2_unwrapFunction · 0.50
conv2DataGradientFunction · 0.50
conv2FilterGradientFunction · 0.50
setDataDimsMethod · 0.50
sparseConvertDenseToCOOFunction · 0.50
topkFunction · 0.50
convolve2_unwrapFunction · 0.50
conv2DataGradientFunction · 0.50
conv2FilterGradientFunction · 0.50
setDataDimsMethod · 0.50
convolve2_unwrapFunction · 0.50

Calls 3

isLinearMethod · 0.45
setDataDimsMethod · 0.45
isReadyMethod · 0.45

Tested by

no test coverage detected