Skip to content

Implemented new layer 'compare'

Yucong Cai requested to merge Yucong/sadl:compare into v8dev

This merge request introduces the Compare layer with the following changes:

Add a new layer "Compare" in sadl/compare.h, which facilitates element-wise comparison between two input tensors. Compare supports two modes: less and greater, controlled by the parameter m_mode.

sadl/layer.h, sadl/layers.h and sadl/model.h have been modified to support the new layer.

converter/main.py have been modified to support the convertion from onnx::Less or onnx::Greater to sadl::Compare.

Test models have been added to utests/models directory. They are present at utests/models/compare_less.onnx and utests/models/compare_greater.onnx.

utests/check.sh has been modified for the new compare_less.onnx and compare_greater.onnx models.

utests/onnx_inference.py has been modified for converting the boolean result as float type, so that the boolean result can be read successfully.

Merge request reports

Loading