| 38 | } |
| 39 | |
| 40 | TensorInfo GetTensorInfo(unsigned int numberOfBatches, |
| 41 | unsigned int numberOfChannels, |
| 42 | unsigned int height, |
| 43 | unsigned int width, |
| 44 | const DataLayout dataLayout, |
| 45 | const DataType dataType) |
| 46 | { |
| 47 | switch (dataLayout) |
| 48 | { |
| 49 | case DataLayout::NCHW: |
| 50 | return TensorInfo({numberOfBatches, numberOfChannels, height, width}, dataType); |
| 51 | case DataLayout::NHWC: |
| 52 | return TensorInfo({numberOfBatches, height, width, numberOfChannels}, dataType); |
| 53 | default: |
| 54 | throw InvalidArgumentException("Unknown data layout [" |
| 55 | + std::to_string(static_cast<int>(dataLayout)) + |
| 56 | "]", CHECK_LOCATION()); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | TensorInfo GetTensorInfo(unsigned int numberOfBatches, |
| 61 | unsigned int numberOfChannels, |