17 using namespace armcomputetensorutils;
28 const arm_compute::TensorInfo aclInputInfo =
29 armcomputetensorutils::BuildArmComputeTensorInfo(input, descriptor.
m_DataLayout);
30 const arm_compute::TensorInfo aclOutputInfo =
31 armcomputetensorutils::BuildArmComputeTensorInfo(output, descriptor.
m_DataLayout);
32 const arm_compute::TensorInfo aclMeanInfo =
33 armcomputetensorutils::BuildArmComputeTensorInfo(mean, descriptor.
m_DataLayout);
34 const arm_compute::TensorInfo aclVarInfo =
35 armcomputetensorutils::BuildArmComputeTensorInfo(var, descriptor.
m_DataLayout);
36 const arm_compute::TensorInfo aclBetaInfo =
37 armcomputetensorutils::BuildArmComputeTensorInfo(beta, descriptor.
m_DataLayout);
38 const arm_compute::TensorInfo aclGammaInfo =
39 armcomputetensorutils::BuildArmComputeTensorInfo(gamma, descriptor.
m_DataLayout);
42 activationDescriptor);
44 return arm_compute::CLBatchNormalizationLayer::validate(&aclInputInfo,
57 const arm_compute::CLCompileContext& clCompileContext)
66 m_Mean = std::make_unique<arm_compute::CLTensor>();
67 BuildArmComputeTensor(*m_Mean,
m_Data.m_Mean->GetTensorInfo());
69 m_Variance = std::make_unique<arm_compute::CLTensor>();
70 BuildArmComputeTensor(*m_Variance,
m_Data.m_Variance->GetTensorInfo());
72 m_Gamma = std::make_unique<arm_compute::CLTensor>();
73 BuildArmComputeTensor(*m_Gamma,
m_Data.m_Gamma->GetTensorInfo());
75 m_Beta = std::make_unique<arm_compute::CLTensor>();
76 BuildArmComputeTensor(*m_Beta,
m_Data.m_Beta->GetTensorInfo());
84 input.info()->set_data_layout(aclDataLayout);
85 output.info()->set_data_layout(aclDataLayout);
91 m_Layer.configure(clCompileContext,
119 void ClBatchNormalizationFloatWorkload::FreeUnusedTensors()
121 FreeTensorIfUnused(m_Mean);
122 FreeTensorIfUnused(m_Variance);
123 FreeTensorIfUnused(m_Gamma);
124 FreeTensorIfUnused(m_Beta);
160 void ClBatchNormalizationFloatWorkload::Reconfigure()