Ejemplo n.º 1
0
 def test_infer_shape(self, x, inp, axis):
     for params in self.op_params:
         if not params[1]:
             continue
         if params[0]:
             f = aet.unique(x, *params, axis=axis)[2]
         else:
             f = aet.unique(x, *params, axis=axis)[1]
         self._compile_and_check(
             [x],
             [f],
             [inp],
             Unique,
         )
Ejemplo n.º 2
0
 def test_basic_vector(self, x, inp, axis):
     list_outs_expected = [
         np.unique(inp, axis=axis),
         np.unique(inp, True, axis=axis),
         np.unique(inp, False, True, axis=axis),
         np.unique(inp, True, True, axis=axis),
         np.unique(inp, False, False, True, axis=axis),
         np.unique(inp, True, False, True, axis=axis),
         np.unique(inp, False, True, True, axis=axis),
         np.unique(inp, True, True, True, axis=axis),
     ]
     for params, outs_expected in zip(self.op_params, list_outs_expected):
         out = aet.unique(x, *params, axis=axis)
         f = aesara.function(inputs=[x], outputs=out)
         outs = f(inp)
         for out, out_exp in zip(outs, outs_expected):
             utt.assert_allclose(out, out_exp)