diff options
author | Jacob Bohlin <jacob.bohlin@arm.com> | 2020-05-20 09:03:40 +0200 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | cf7da10987cac3fc68cf180a9af665fe06d608fa (patch) | |
tree | 5467fe8b062e4e37a4e0dadc178a9716d233facc /ethosu/vela/register_command_stream_generator.py | |
parent | 5b3dcd7323a5852bd188bb3929e7f38db3b52862 (diff) | |
download | ethos-u-vela-cf7da10987cac3fc68cf180a9af665fe06d608fa.tar.gz |
MLBEDSW-1716: Transpose Convolution support
Change-Id: Ie6d8d6de9f3447f19ba06aafa9fa480fc96a973b
Signed-off-by: Jacob Bohlin <jacob.bohlin@arm.com>
Diffstat (limited to 'ethosu/vela/register_command_stream_generator.py')
-rw-r--r-- | ethosu/vela/register_command_stream_generator.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index 3da8bbcf..11c0c20d 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -38,6 +38,7 @@ from .ethos_u55_regs.ethos_u55_regs import cmd0 from .ethos_u55_regs.ethos_u55_regs import cmd1 from .ethos_u55_regs.ethos_u55_regs import elementwise_mode from .ethos_u55_regs.ethos_u55_regs import ifm_precision +from .ethos_u55_regs.ethos_u55_regs import resampling_mode from .ethos_u55_regs.ethos_u55_regs import rounding from .high_level_command_stream import CommandType from .numeric_util import clamp_sigmoid @@ -555,9 +556,12 @@ def generate_register_command_stream(nng, sg, arch, verbose=False): if primary_op.type == "ResizeBilinear": # perform nearest neighbor upscale - emit.cmd0_with_param(cmd0.NPU_SET_IFM_UPSCALE, 1) + emit.cmd0_with_param(cmd0.NPU_SET_IFM_UPSCALE, resampling_mode.NEAREST) + elif primary_op.type == "Conv2DBackpropInputSwitchedBias": + # perform insert zero upscale + emit.cmd0_with_param(cmd0.NPU_SET_IFM_UPSCALE, resampling_mode.TRANSPOSE) else: - emit.cmd0_with_param(cmd0.NPU_SET_IFM_UPSCALE, 0) + emit.cmd0_with_param(cmd0.NPU_SET_IFM_UPSCALE, resampling_mode.NONE) if npu_block_type in set( (NpuBlockType.ConvolutionMxN, NpuBlockType.ConvolutionDepthWise, NpuBlockType.Pooling) |