10 #include <boost/assert.hpp> 26 std::unique_ptr<Decoder<float>> decoderPtr =
27 MakeDecoder<float>(inputInfo, data.
m_Inputs[0]->Map());
30 for (
unsigned int index = 0; index < inputInfo.GetNumElements(); ++index)
34 unsigned int indexRemainder = index;
35 unsigned int dimensionStride = inputInfo.GetNumElements();
37 for (
unsigned int i = 0; i<inputInfo.GetNumDimensions(); i++)
39 dimensionStride /= inputInfo.GetShape()[i];
40 indices[i] = indexRemainder / dimensionStride;
41 indexRemainder -= indices[i] * dimensionStride;
44 for (
unsigned int viewIdx = 0; viewIdx < data.
m_ViewOrigins.size(); ++viewIdx)
53 bool insideView =
true;
68 std::unique_ptr<Encoder<float>> encoderPtr =
69 MakeEncoder<float>(outputInfo, data.
m_Outputs[viewIdx]->Map());
72 unsigned int outIndex = 0;
73 unsigned int dimensionStride = 1;
74 float inputValue = 0.f;
76 for (
unsigned int i = outputInfo.GetNumDimensions(); i-- > 0;)
78 outIndex += dimensionStride * (indices[i] - view.
m_Origin[i]);
79 dimensionStride *= outputInfo.GetShape()[i];
83 inputValue = decoder.
Get();
87 encoder.Set(inputValue);
unsigned int GetNumDimensions() const
constexpr unsigned int MaxNumOfTensorDimensions
std::vector< ViewOrigin > m_ViewOrigins
void Split(const SplitterQueueDescriptor &data)
std::vector< ITensorHandle * > m_Outputs
std::vector< ITensorHandle * > m_Inputs
std::vector< unsigned int > m_Origin
const TensorShape & GetShape() const
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
virtual IType Get() const =0