13 #include <arm_compute/core/Types.h>
17 using namespace armcomputetensorutils;
21 size_t CalcAxis(
const OriginsDescriptor& descriptor)
23 return (descriptor.GetNumDimensions() - descriptor.GetConcatAxis()) - 1;
31 std::vector<arm_compute::TensorInfo> aclInputs;
35 aclInputs.emplace_back(aclInputInfo);
37 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
38 std::vector<const arm_compute::ITensorInfo*> aclInputPtrs;
39 for (arm_compute::ITensorInfo& input : aclInputs)
41 aclInputPtrs.emplace_back(&input);
44 size_t aclAxis = CalcAxis(descriptor);
45 return arm_compute::CLConcatenateLayer::validate(aclInputPtrs, &aclOutputInfo, aclAxis);
50 const arm_compute::CLCompileContext& clCompileContext)
59 bool allInputsAreSubtensors =
true;
62 for (
auto input : descriptor.
m_Inputs)
64 if (!input->GetParent())
67 allInputsAreSubtensors =
false;
72 if (allInputsAreSubtensors)
78 std::vector<const arm_compute::ICLTensor *> aclInputs;
81 arm_compute::ICLTensor& aclInput = armnn::PolymorphicPointerDowncast<IClTensorHandle>(input)->GetTensor();
82 aclInputs.emplace_back(&aclInput);
85 arm_compute::ICLTensor& output =
86 armnn::PolymorphicPointerDowncast<IClTensorHandle>(
m_Data.
m_Outputs[0])->GetTensor();
89 auto layer = std::make_unique<arm_compute::CLConcatenateLayer>();
95 layer->configure(clCompileContext, aclInputs, &output, aclAxis);
100 m_Layer = std::move(layer);