diff options
author | Kevin Cheng <kevin.cheng@arm.com> | 2021-03-03 11:21:43 -0800 |
---|---|---|
committer | Kevin Cheng <kevin.cheng@arm.com> | 2021-04-27 16:01:59 -0700 |
commit | 550ccc52de231621c0bf0c05ae2a398eec37ff51 (patch) | |
tree | d4a5bd8d24560135784208c0fe35615b1d043249 /reference_model/src/ops | |
parent | cf6224e6e8ba4fc2984de3e542538c38e27c9f57 (diff) | |
download | reference_model-550ccc52de231621c0bf0c05ae2a398eec37ff51.tar.gz |
Replace serialization/ and verif/ with MLPlatform's serialization_lib submodule
- Remove Usage and Format
- Run black on verif/*.py scripts
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com>
Change-Id: Ie81515891eb0039540f614894f4b6b0e0e78ba74
Diffstat (limited to 'reference_model/src/ops')
-rw-r--r-- | reference_model/src/ops/control_flow.cc | 5 | ||||
-rw-r--r-- | reference_model/src/ops/tensor_ops.cc | 63 |
2 files changed, 2 insertions, 66 deletions
diff --git a/reference_model/src/ops/control_flow.cc b/reference_model/src/ops/control_flow.cc index 9d5db40..827e01f 100644 --- a/reference_model/src/ops/control_flow.cc +++ b/reference_model/src/ops/control_flow.cc @@ -292,9 +292,8 @@ int OpWhileLoop::checkTensorAttributes() int OpWhileLoop::eval() { - TosaReference::Tensor0<bool> cond_output_ctensor( - std::string("cond_output"), DType_BOOL, std::vector<Usage>({ Usage_ACTIVATION }), - std::vector<Format>({ Format_UNKNOWN }), std::vector<int32_t>({}), false); + TosaReference::Tensor0<bool> cond_output_ctensor(std::string("cond_output"), DType_BOOL, + std::vector<int32_t>({})); cond_output_ctensor.allocate(); std::vector<TosaReference::Tensor*> cond_block_outputs; diff --git a/reference_model/src/ops/tensor_ops.cc b/reference_model/src/ops/tensor_ops.cc index d6cd1cd..b8c7ade 100644 --- a/reference_model/src/ops/tensor_ops.cc +++ b/reference_model/src/ops/tensor_ops.cc @@ -103,12 +103,6 @@ int OpAvgPool2d<Dtype>::checkTensorAttributes() in = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]); out = dynamic_cast<TosaReference::TensorTemplate<TOut>*>(outputs[0]); - if (!in->hasFormat(Format_NHWC)) - { - printNodeValidationError("OpAvgPool2d: unsupported tensor format"); - return 1; - } - if (attribute->padding().size() != 4) { printNodeValidationError("OpAvgPool2d: illegal size for attribute padding"); @@ -321,28 +315,11 @@ int OpConv2d<InDtype, WeightDtype>::checkTensorAttributes() printNodeValidationError("OpConv2d: bias tensor must be rank 1"); } - if (inputs[1]->getIsConst() == 0) - { - printNodeValidationError("OpConv2d: weight tensor is not const typed"); - } - input = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]); weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]); bias = dynamic_cast<TosaReference::TensorTemplate<TBias>*>(inputs[2]); output = dynamic_cast<TosaReference::TensorTemplate<TAcc>*>(outputs[0]); - if (!input->hasFormat(Format_NHWC)) - { - printNodeValidationError("OpConv2d: unsupported input tensor format"); - return 1; - } - - if (!weight->hasFormat(Format_OHWI)) - { - printNodeValidationError("OpConv2d: unsupported weight tensor format"); - return 1; - } - if (attribute->padding().size() != 4) { printNodeValidationError("OpConv2d: illegal size for attribute padding"); @@ -530,28 +507,11 @@ int OpDepthwiseConv2d<InDtype, WeightDtype>::checkTensorAttributes() printNodeValidationError("OpDepthwiseConv2d: bias tensor must be rank 1"); } - if (inputs[1]->getIsConst() == 0) - { - printNodeValidationError("OpDepthwiseConv2d: weight tensor is not const typed"); - } - input = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]); weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]); bias = dynamic_cast<TosaReference::TensorTemplate<TBias>*>(inputs[2]); output = dynamic_cast<TosaReference::TensorTemplate<TAcc>*>(outputs[0]); - if (!input->hasFormat(Format_NHWC)) - { - printNodeValidationError("OpDepthwiseConv2d: unsupported input tensor format"); - return 1; - } - - if (!weight->hasFormat(Format_HWIM)) - { - printNodeValidationError("OpDepthwiseConv2d: unsupported weight tensor format"); - return 1; - } - if (attribute->padding().size() != 4) { printNodeValidationError("OpDepthwiseConv2d: illegal size for attribute padding"); @@ -881,12 +841,6 @@ int OpMaxPool2d<Dtype>::checkTensorAttributes() in = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]); out = dynamic_cast<TosaReference::TensorTemplate<TOut>*>(outputs[0]); - if (!in->hasFormat(Format_NHWC)) - { - printNodeValidationError("OpMaxPool2d: unsupported tensor format"); - return 1; - } - if (attribute->padding().size() != 4) { printNodeValidationError("OpMaxPool2d: illegal size for attribute padding"); @@ -1021,28 +975,11 @@ int OpTransposeConv2d<InDtype, OutDtype>::checkTensorAttributes() return 1; } - if (inputs[1]->getIsConst() == 0) - { - printNodeValidationError("OpTransposeConv2d: weight tensor is not const typed"); - } - input = dynamic_cast<TosaReference::TensorTemplate<TIn>*>(inputs[0]); weight = dynamic_cast<TosaReference::TensorTemplate<TWeight>*>(inputs[1]); bias = dynamic_cast<TosaReference::TensorTemplate<TBias>*>(inputs[2]); output = dynamic_cast<TosaReference::TensorTemplate<TAcc>*>(outputs[0]); - if (!input->hasFormat(Format_NHWC)) - { - printNodeValidationError("OpTransposeConv2d: unsupported input tensor format"); - return 1; - } - - if (!weight->hasFormat(Format_OHWI)) - { - printNodeValidationError("OpTransposeConv2d: unsupported weight tensor format"); - return 1; - } - if (attribute->outpad().size() != 2) { printNodeValidationError("OpTransposeConv2d: illegal size for attribute outpad"); |