10 using namespace armnn;
11 using namespace armnn::armcomputetensorutils;
12 using namespace arm_compute::experimental::dynamic_fusion;
16 const arm_compute::Padding2D padInfo = BuildArmComputePaddingInfo(descriptor);
17 const arm_compute::Size2D strideInfo = BuildArmComputeSize2D(descriptor.
m_StrideX, descriptor.
m_StrideY);
18 const arm_compute::Size2D dilationInfo = BuildArmComputeSize2D(descriptor.
m_DilationX, descriptor.
m_DilationY);
20 arm_compute::experimental::dynamic_fusion::Conv2dAttributes conv2dAttributes{};
21 conv2dAttributes.pad(padInfo);
22 conv2dAttributes.stride(strideInfo);
23 conv2dAttributes.dilation(dilationInfo);
25 return conv2dAttributes;
28 arm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes
31 const arm_compute::Padding2D padInfo = BuildArmComputePaddingInfo(descriptor);
32 const arm_compute::Size2D strideInfo = BuildArmComputeSize2D(descriptor.
m_StrideX, descriptor.
m_StrideY);
33 const arm_compute::Size2D dilationInfo = BuildArmComputeSize2D(descriptor.
m_DilationX, descriptor.
m_DilationY);
35 arm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes depthwiseConv2dAttributes{};
36 depthwiseConv2dAttributes.pad(padInfo);
37 depthwiseConv2dAttributes.stride(strideInfo);
38 depthwiseConv2dAttributes.dilation(dilationInfo);
39 depthwiseConv2dAttributes.depth_multiplier(aclDepthMultiplier);
41 return depthwiseConv2dAttributes;
44 arm_compute::experimental::dynamic_fusion::Pool2dAttributes
48 const arm_compute::Padding2D padding = BuildArmComputePaddingInfo(descriptor);
50 const arm_compute::Size2D strides = BuildArmComputeSize2D(descriptor.
m_StrideX, descriptor.
m_StrideY);
53 arm_compute::experimental::dynamic_fusion::Pool2dAttributes pool2dAttributes{};
54 pool2dAttributes.pool_type(poolType);
55 pool2dAttributes.pad(padding);
56 pool2dAttributes.pool_size(poolSize);
57 pool2dAttributes.stride(strides);
58 pool2dAttributes.exclude_padding(excludePadding);
60 return pool2dAttributes;
63 arm_compute::experimental::dynamic_fusion::ResizeAttributes
66 arm_compute::experimental::dynamic_fusion::ResizeAttributes resizeAttributes{};
67 resizeAttributes.output_width(
static_cast<int32_t
>(descriptor.
m_TargetWidth));
68 resizeAttributes.output_height(
static_cast<int32_t
>(descriptor.
m_TargetHeight));
70 arm_compute::InterpolationPolicy::BILINEAR :
71 arm_compute::InterpolationPolicy::NEAREST_NEIGHBOR);
72 resizeAttributes.sampling_policy(descriptor.
m_HalfPixelCenters ? arm_compute::SamplingPolicy::CENTER
73 : arm_compute::SamplingPolicy::TOP_LEFT);
76 return resizeAttributes;