21 using namespace armcomputetensorutils;
25 unsigned int CalcAclAxis(
unsigned int numDimensions,
unsigned int splitAxis)
27 return (numDimensions - splitAxis) - 1;
33 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
34 unsigned int splitAxis)
36 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input);
38 size_t numOutputs = outputs.size();
40 std::vector<arm_compute::TensorInfo> aclOutputs;
41 aclOutputs.reserve(numOutputs);
43 std::vector<arm_compute::ITensorInfo*> aclOutputPtr;
44 aclOutputPtr.reserve(numOutputs);
46 for (
size_t i = 0u; i < outputs.size(); ++i)
48 aclOutputs.emplace_back(BuildArmComputeTensorInfo(outputs[i]));
49 aclOutputPtr.emplace_back(&aclOutputs.back());
53 return arm_compute::CLSplit::validate(&aclInputInfo, aclOutputPtr, aclAxis);
58 const arm_compute::CLCompileContext&)
66 bool allOutputsAreSubtensors =
true;
71 if (output && !output->GetParent())
74 allOutputsAreSubtensors =
false;
79 if (allOutputsAreSubtensors)
85 arm_compute::ICLTensor& input = armnn::PolymorphicPointerDowncast<IClTensorHandle>(
88 std::vector<arm_compute::ICLTensor *> aclOutputs;
91 arm_compute::ICLTensor& aclOutput = armnn::PolymorphicPointerDowncast<IClTensorHandle>(output)->GetTensor();
92 aclOutputs.emplace_back(&aclOutput);
99 if (splitAxis.size() != 1)
105 auto layer = std::make_unique<arm_compute::CLSplit>();
108 layer->configure(&input, aclOutputs, aclAxis);
114 m_Layer = std::move(layer);