def test_or(op_tester):
    d1 = (np.random.randn(2) > 0).astype(np.bool_)
    d2 = (np.random.randn(2) > 0).astype(np.bool_)

    def init_builder(builder):
        i1 = builder.addInputTensor(d1)
        i2 = builder.addInputTensor(d2)
        o = builder.aiOnnx.logical_or([i1, i2])
        builder.addOutputTensor(o)
        return [o]

    def reference(ref_data):
        t1 = torch.tensor(d1, dtype=torch.bool)
        t2 = torch.tensor(d2, dtype=torch.bool)
        out = (t1 | t2)
        return [out]
    op_tester.run(init_builder, reference, step_type='infer')
def test_or(op_tester):
    d1 = (np.random.randn(2) > 0).astype(np.bool_)
    d2 = (np.random.randn(2) > 0).astype(np.bool_)

    def init_builder(builder):
        i1 = builder.addInputTensor(d1)
        i2 = builder.addInputTensor(d2)
        o = builder.aiOnnx.logical_or([i1, i2])
        builder.addOutputTensor(o)
        return [o]

    def reference(ref_data):
        t1 = torch.tensor(d1, dtype=torch.bool)
        t2 = torch.tensor(d2, dtype=torch.bool)
        out = (t1 | t2)
        return [out]
    op_tester.run(init_builder, reference, step_type='infer')