| 20 | |
| 21 | template<typename inType, typename outType> |
| 22 | Array<outType> reshape(const Array<inType> &in, const dim4 &outDims, |
| 23 | outType defaultValue, double scale) { |
| 24 | Array<outType> out = createEmptyArray<outType>(outDims); |
| 25 | if (out.elements() > 0) { |
| 26 | kernel::copy<inType, outType>(out, in, in.ndims(), defaultValue, scale, |
| 27 | in.dims() == outDims); |
| 28 | } |
| 29 | return out; |
| 30 | } |
| 31 | |
| 32 | #define INSTANTIATE(SRC_T) \ |
| 33 | template Array<float> reshape<SRC_T, float>(Array<SRC_T> const &, \ |