16 template <
typename DataType>
18 std::vector<ITensorHandle*> inputs,
19 std::vector<ITensorHandle*> outputs)
23 for (
unsigned int index = 0; index < inputInfo0.
GetNumElements(); ++index)
27 unsigned int indexRemainder = index;
32 dimensionStride /= inputInfo0.
GetShape()[i];
33 indices[i] = indexRemainder / dimensionStride;
34 indexRemainder -= indices[i] * dimensionStride;
37 for (
unsigned int viewIdx = 0; viewIdx < data.
m_ViewOrigins.size(); ++viewIdx)
45 "The number of output dimensions does not match the number of input dimensions.");
48 bool insideView =
true;
63 unsigned int outIndex = 0;
64 unsigned int dimensionStride = 1;
68 outIndex += dimensionStride * (indices[i] - view.
m_Origin[i]);
69 dimensionStride *= outputInfo.
GetShape()[i];
73 DataType* outputData = GetOutputTensorData<DataType>(viewIdx, data);
74 const DataType* inputData = GetInputTensorData<DataType>(0, data);
75 outputData[outIndex] = inputData[index];
81 void Split(
const SplitterQueueDescriptor& data,
82 std::vector<ITensorHandle*> inputs,
83 std::vector<ITensorHandle*> outputs);