diff options
author | Tai Ly <tai.ly@arm.com> | 2023-12-18 20:40:24 +0000 |
---|---|---|
committer | Tai Ly <tai.ly@arm.com> | 2024-01-18 23:50:04 +0000 |
commit | 8690a0873fac28acccbb0acb15c16e8337e14df1 (patch) | |
tree | a13d5e195d8b7becffc23da98fde7449e91c96e4 /reference_model/src/ops/op_factory.cc | |
parent | 9f5febe05901bfbd3919ef17f2caea8087cd9ccf (diff) | |
download | reference_model-8690a0873fac28acccbb0acb15c16e8337e14df1.tar.gz |
[reference model] Add shape operators
- fixed up reshape conformance tests to use shape input instead of attribute
- fixed up tile conformance tests to use shape input instead of attribute
- fixed output and output rank of dim op
- allow rank 0 and rank 1 tensors for tosa.shape values (for shape = {})
- added initialization of rank 0 const_shape tensors (for shape = {})
- Update conformance tests to use new rescale attributes
Signed-off-by: Tai Ly <tai.ly@arm.com>
Signed-off-by: Won Jeon <won.jeon@arm.com>
Change-Id: I6cce0d2a9ab066fe20a2abf9d2cfde3eb3d8c18b
Diffstat (limited to 'reference_model/src/ops/op_factory.cc')
-rw-r--r-- | reference_model/src/ops/op_factory.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/reference_model/src/ops/op_factory.cc b/reference_model/src/ops/op_factory.cc index 34db903..af8332e 100644 --- a/reference_model/src/ops/op_factory.cc +++ b/reference_model/src/ops/op_factory.cc @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023, ARM Limited. +// Copyright (c) 2020-2024, ARM Limited. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ #include "image.h" #include "reduction.h" #include "scatter_gather.h" +#include "shape.h" #include "tensor_ops.h" #include "type_conversion.h" @@ -600,6 +601,19 @@ GraphNode* OpFactory::newOp(SubgraphTraverser* sgt, case Op_WHILE_LOOP: return new OpWhileLoop(sgt, tsh, attribute, id); + case Op_CONST_SHAPE: + return new OpConstShape(sgt, id); + case Op_CONCAT_SHAPE: + return new OpConcatShape(sgt, id); + case Op_ADD_SHAPE: + return new OpAddShape(sgt, id); + case Op_SUB_SHAPE: + return new OpSubShape(sgt, id); + case Op_MUL_SHAPE: + return new OpMulShape(sgt, id); + case Op_DIV_SHAPE: + return new OpDivShape(sgt, id); + // Ops not recognized default: goto done; |