From a98346f4cd1a0468ac2d1d30574607698f7432bc Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 19 Jul 2017 21:06:07 -0500 Subject: [PATCH] Add comment to `OpTestMeta` (#2968) --- python/paddle/v2/framework/tests/op_test_util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/paddle/v2/framework/tests/op_test_util.py b/python/paddle/v2/framework/tests/op_test_util.py index 237f9b7eb0..b1fa12cc89 100644 --- a/python/paddle/v2/framework/tests/op_test_util.py +++ b/python/paddle/v2/framework/tests/op_test_util.py @@ -5,6 +5,18 @@ import paddle.v2.framework.create_op_creation_methods as creation 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): obj = super(OpTestMeta, cls).__new__(cls, name, bases, attrs) -- GitLab