aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ConversionUtils.hpp37
-rw-r--r--ConversionUtils_1_2.hpp11
2 files changed, 48 insertions, 0 deletions
diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp
index d19131ce..15381338 100644
--- a/ConversionUtils.hpp
+++ b/ConversionUtils.hpp
@@ -1052,6 +1052,43 @@ bool GetOptionalConvolutionDilationParams(const HalOperation& operation,
}
template<typename HalPolicy,
+ typename HalOperation = typename HalPolicy::Operation,
+ typename HalModel = typename HalPolicy::Model>
+bool GetOptionalBool(const HalOperation& operation,
+ uint32_t inputIndex,
+ const HalModel& model,
+ const ConversionData& data)
+{
+ using HalOperand = typename HalPolicy::Operand;
+
+ const HalOperand* operand = GetInputOperand<HalPolicy>(operation, inputIndex, model);
+ if (!operand)
+ {
+ return false;
+ }
+
+ if (!IsBool(*operand))
+ {
+ return false;
+ }
+
+ const void* valueAddress = GetOperandValueReadOnlyAddress<HalPolicy>(*operand, model, data);
+ if (!valueAddress)
+ {
+ return false;
+ }
+
+ if (*(static_cast<const bool*>(valueAddress)))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+template<typename HalPolicy,
typename HalOperand = typename HalPolicy::Operand,
typename HalModel = typename HalPolicy::Model>
bool GetTensorInt32Values(const HalOperand& operand,
diff --git a/ConversionUtils_1_2.hpp b/ConversionUtils_1_2.hpp
index 460c88bd..c87cb030 100644
--- a/ConversionUtils_1_2.hpp
+++ b/ConversionUtils_1_2.hpp
@@ -1825,6 +1825,17 @@ bool ConvertResize(const HalOperation& operation,
return Fail("%s: Operand has invalid data type for resizing by scale", __func__);
}
+ descriptor.m_BilinearAlignCorners = GetOptionalBool<HalPolicy>(operation, 4, model, data);
+ descriptor.m_HalfPixelCenters = GetOptionalBool<HalPolicy>(operation, 5, model, data);
+ if (descriptor.m_BilinearAlignCorners)
+ {
+ return Fail("%s: Resize Align Corners is not currently supported", __func__);
+ }
+ if (descriptor.m_HalfPixelCenters)
+ {
+ return Fail("%s: Resize Half Pixel Centers is not currently supported", __func__);
+ }
+
bool isSupported = false;
FORWARD_LAYER_SUPPORT_FUNC(__func__,
IsResizeSupported,