| 13 | { |
| 14 | |
| 15 | TensorShape GetUnpaddedTensorStrides(const TensorInfo& tensorInfo) |
| 16 | { |
| 17 | TensorShape shape(tensorInfo.GetShape()); |
| 18 | auto size = GetDataTypeSize(tensorInfo.GetDataType()); |
| 19 | auto runningSize = size; |
| 20 | std::vector<unsigned int> strides(shape.GetNumDimensions()); |
| 21 | auto lastIdx = shape.GetNumDimensions()-1; |
| 22 | for (unsigned int i=0; i < lastIdx ; i++) |
| 23 | { |
| 24 | strides[lastIdx-i] = runningSize; |
| 25 | runningSize *= shape[lastIdx-i]; |
| 26 | } |
| 27 | strides[0] = runningSize; |
| 28 | return TensorShape(shape.GetNumDimensions(), strides.data()); |
| 29 | } |
| 30 | |
| 31 | ConstTensorHandle::ConstTensorHandle(const TensorInfo& tensorInfo) |
| 32 | : m_TensorInfo(tensorInfo) |
no test coverage detected