diff options
author | TatWai Chong <tatwai.chong@arm.com> | 2022-06-08 12:17:14 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-08-10 23:12:28 +0000 |
commit | f732609a51630c98bc3f448937988fbcf20dc854 (patch) | |
tree | c19aeb8919e4ae8db84b13559bd5858f5e785382 /reference_model/src/ops/op_factory.h | |
parent | 9391243d1c24d5a4e3c227ba9e3689cdb12d3e60 (diff) | |
download | reference_model-f732609a51630c98bc3f448937988fbcf20dc854.tar.gz |
Update TOSA resize to match specification
Attribute stride and shift are removed, and has new scale and border.
Also add tests in the generator to test tf.resize with all option
combinations.
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: If0f330d04395762d2d907863235eda1532f5e1ff
Diffstat (limited to 'reference_model/src/ops/op_factory.h')
-rw-r--r-- | reference_model/src/ops/op_factory.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/reference_model/src/ops/op_factory.h b/reference_model/src/ops/op_factory.h index 4cb8178..341d7dc 100644 --- a/reference_model/src/ops/op_factory.h +++ b/reference_model/src/ops/op_factory.h @@ -41,37 +41,43 @@ switch (inputRank) \ { \ case 0: \ - return new OP<0>(sgt, attribute, id); \ + return new OP<0>(sgt, attribute, id); \ case 1: \ - return new OP<1>(sgt, attribute, id); \ + return new OP<1>(sgt, attribute, id); \ case 2: \ - return new OP<2>(sgt, attribute, id); \ + return new OP<2>(sgt, attribute, id); \ case 3: \ - return new OP<3>(sgt, attribute, id); \ + return new OP<3>(sgt, attribute, id); \ case 4: \ - return new OP<4>(sgt, attribute, id); \ + return new OP<4>(sgt, attribute, id); \ case 5: \ - return new OP<5>(sgt, attribute, id); \ + return new OP<5>(sgt, attribute, id); \ case 6: \ - return new OP<6>(sgt, attribute, id); \ + return new OP<6>(sgt, attribute, id); \ } #define DEF_FACTORY_ONE_TYPE(OP, DTYPE) \ if (inputDType == DType_##DTYPE) \ { \ - return new OP<DType_##DTYPE>(sgt, attribute, id); \ + return new OP<DType_##DTYPE>(sgt, attribute, id); \ } #define DEF_FACTORY_TWO_TYPE(OP, DTYPE1, DTYPE2) \ if (inputDType == DType_##DTYPE1 && weightDType == DType_##DTYPE2) \ { \ - return new OP<DType_##DTYPE1, DType_##DTYPE2>(sgt, attribute, id); \ + return new OP<DType_##DTYPE1, DType_##DTYPE2>(sgt, attribute, id); \ } -#define DEF_FACTORY_TWO_TYPE_RESIZE(OP, DTYPE1, DTYPE2) \ +#define DEF_FACTORY_TWO_TYPE_RESIZE_INT16(OP, DTYPE1, DTYPE2) \ if (inputDType == DType_##DTYPE1 && outputDType == DType_##DTYPE2) \ { \ - return new OP<DType_##DTYPE1, DType_##DTYPE2>(sgt, attribute, id); \ + return new OP<DType_##DTYPE1, DType_##DTYPE2, int16_t>(sgt, attribute, id); \ + } + +#define DEF_FACTORY_TWO_TYPE_RESIZE_FLOAT(OP, DTYPE1, DTYPE2) \ + if (inputDType == DType_##DTYPE1 && outputDType == DType_##DTYPE2) \ + { \ + return new OP<DType_##DTYPE1, DType_##DTYPE2, float>(sgt, attribute, id); \ } #define DEF_FACTORY_RANK0_6_ONE_RANK_ONE_TYPE(OP, DTYPE) \ |