Exemplo n.º 1
0
 def __init__(self, X, op_version=None, **kwargs):
     """
     :param X: array or OnnxOperatorMixin
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     OnnxOperator.__init__(self, X, op_version=op_version, **kwargs)
Exemplo n.º 2
0
 def __init__(self,
              text,
              mark=0,
              mincharnum=1,
              pad_value='#',
              separators=None,
              tokenexp='[a-zA-Z0-9_]+',
              stopwords=None,
              op_version=None,
              **kwargs):
     """
     :param text: array or OnnxOperatorMixin
     :param mark: see :epkg:`Tokenizer`
     :param pad_value: see :epkg:`Tokenizer`
     :param separators: see :epkg:`Tokenizer`
     :param tokenexp: see :epkg:`Tokenizer`
     :param stopwords: list of stopwords, addition to :epkg:`Tokenizer`
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     if separators is None:
         separators = []
     if stopwords is None:
         stopwords = []
     OnnxOperator.__init__(self,
                           text,
                           mark=mark,
                           mincharnum=mincharnum,
                           pad_value=pad_value,
                           separators=separators,
                           tokenexp=tokenexp,
                           stopwords=stopwords,
                           op_version=op_version,
                           **kwargs)
Exemplo n.º 3
0
 def __init__(self, a_shape, b_shape, op_version=None, **kwargs):
     """
     :param a_shape: The 1st input shape as Tensor.
     :param b_shape: The 2nds input shape as Tensor.
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     OnnxOperator.__init__(self,
                           a_shape,
                           b_shape,
                           op_version=op_version,
                           **kwargs)
Exemplo n.º 4
0
 def __init__(self, grad, prob, op_version=None, **kwargs):
     """
     :param grad: gradient
     :param prob: probablities
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     OnnxOperator.__init__(self,
                           grad,
                           prob,
                           op_version=op_version,
                           **kwargs)
Exemplo n.º 5
0
 def __init__(self, *args, axis=-1, op_version=None, **kwargs):
     """
     :param A: array or OnnxOperatorMixin
     :param fft_length: (optional) array or OnnxOperatorMixin (args)
     :param axis: axis
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     OnnxOperator.__init__(self,
                           *args,
                           axis=axis,
                           op_version=op_version,
                           **kwargs)
Exemplo n.º 6
0
 def __init__(self, X, Y, transA=0, transB=0, op_version=None, **kwargs):
     """
     :param X: first matrix
     :param Y: second matrix
     :param transA: transpose first matrix
     :param transB: transpose second matrix
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     OnnxOperator.__init__(self,
                           X,
                           Y,
                           transA=transA,
                           transB=transB,
                           op_version=op_version,
                           **kwargs)
Exemplo n.º 7
0
 def __init__(self,
              X,
              non_differentiable_outputs=None,
              full_shape_outputs=None,
              op_version=None,
              **kwargs):
     """
     :param X: array or OnnxOperatorMixin
     :param non_differentiable_outputs: the indices of the module
         outputs that doesn't have a gradient.
     :param full_shape_outputs: the indices of the module outputs
         that must have full shape.
     :param op_version: opset version
     :param kwargs: additional parameter
     """
     OnnxOperator.__init__(self, X, op_version=op_version, **kwargs)
     self.non_differentiable_outputs = non_differentiable_outputs
     self.full_shape_outputs = full_shape_outputs
Exemplo n.º 8
0
 def test_constant(self):
     cst = OnnxOperator.ConstantVariable("a")
     self.assertEqual(cst.value, "a")
Exemplo n.º 9
0
 def test_unscoped(self):
     var2 = OnnxOperator.UnscopedVariable("a")
     var1 = OnnxOperator.UnscopedVariable("a")
     self.assertEqual(var1, var2)
     self.assertEqual(var1, "a")
     self.assertEqual(repr(var1), "UnscopedVariable('a')")