21 const bool isFastMathEnabled,
26 throw Exception(
"Support for adjoint not implemented.");
30 throw Exception(
"Only supported the MatMul in the last 2 dimensions");
33 arm_compute::TensorInfo aclInputInfoX = armcomputetensorutils::BuildArmComputeTensorInfo(inputInfoX);
34 arm_compute::TensorInfo aclInputInfoY = armcomputetensorutils::BuildArmComputeTensorInfo(inputInfoY);
35 arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(outputInfo);
38 aclInputInfoX.set_are_values_constant(
false);
39 aclInputInfoY.set_are_values_constant(
false);
42 activationDescriptor);
44 arm_compute::MatMulInfo matMulInfo;
47 matMulInfo.fused_activation(activationInfo);
49 arm_compute::CpuMatMulSettings settings;
50 settings.fast_math(isFastMathEnabled);
52 return arm_compute::NEMatMul::validate(&aclInputInfoX, &aclInputInfoY, &aclOutputInfo, matMulInfo, settings);
57 const bool isFastMathEnabled)
62 throw Exception(
"Support for adjoint not implemented.");
67 throw Exception(
"Only supported the MatMul in the last 2 dimensions");
72 arm_compute::ITensor& inputX = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[0])->GetTensor();
73 arm_compute::ITensor& inputY = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[1])->GetTensor();
74 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Outputs[0])->GetTensor();
77 inputX.info()->set_are_values_constant(
false);
78 inputY.info()->set_are_values_constant(
false);
82 arm_compute::MatMulInfo matMulInfo;
85 matMulInfo.fused_activation(activationInfo);
87 arm_compute::CpuMatMulSettings settings;
88 settings.fast_math(isFastMathEnabled);
90 m_MatMulLayer.configure(&inputX, &inputY, &output, matMulInfo, settings);