Skip to content

Commit 49ef7ce

Browse files
committed
ut
1 parent 06a15a9 commit 49ef7ce

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

_unittests/ut_light_api/test_light_api.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,23 @@ def test_if(self):
472472
got = ref.run(None, {"X": -x})
473473
self.assertEqualArray(np.array([0], dtype=np.int64), got[0])
474474

475+
def test_domain(self):
476+
onx = (
477+
start()
478+
.vin("X")
479+
.reshape((-1, 1))
480+
.dom["ai.onnx.ml"].Normalizer(norm="L1")
481+
.rename("Y")
482+
.vout()
483+
.to_onnx()
484+
)
485+
self.assertIsInstance(onx, ModelProto)
486+
self.assertIn("Transpose", str(onx))
487+
ref = ReferenceEvaluator(onx)
488+
a = np.arange(10).astype(np.float32)
489+
got = ref.run(None, {"X": a})[0]
490+
self.assertEqualArray(a.reshape((-1, 1)).T, got)
491+
475492

476493
if __name__ == "__main__":
477494
TestLightApi().test_if()

0 commit comments

Comments
 (0)