|
|
|
@ -5,6 +5,18 @@ import paddle.v2.framework.create_op_creation_methods as creation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OpTestMeta(type):
|
|
|
|
class OpTestMeta(type):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
Operator Test ClassMeta.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It injects `test_all` method into user's OperatorTest class, to make Python
|
|
|
|
|
|
|
|
unittest module run that method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The `test_all` read what value is stored in `self`. It use self's values to
|
|
|
|
|
|
|
|
create and run a operator, and check whether that op is OK or not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See `test_add_two_op` for example usage.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def __new__(cls, name, bases, attrs):
|
|
|
|
def __new__(cls, name, bases, attrs):
|
|
|
|
obj = super(OpTestMeta, cls).__new__(cls, name, bases, attrs)
|
|
|
|
obj = super(OpTestMeta, cls).__new__(cls, name, bases, attrs)
|
|
|
|
|
|
|
|
|
|
|
|
|