提交 8da55872 编写于 作者: Y Yu Yang

Init commit

上级 cd5113c1
import paddle.v2.framework.core as core
import paddle.v2.framework.proto.op_proto_pb2 as op_proto_pb2
def get_all_op_protos():
protostrs = core.get_all_op_protos()
ret_values = []
for pbstr in protostrs:
op_proto = op_proto_pb2.OpProto()
op_proto.ParseFromString(pbstr)
ret_values.append(op_proto)
return ret_values
add_python_test(test_framework test_protobuf.py test_scope.py
test_default_scope_funcs.py)
test_default_scope_funcs.py test_op_creation_methods.py)
import unittest
import paddle.v2.framework.create_op_creation_methods as creation
class TestOpCreationsMethods(unittest.TestCase):
def test_all_protos(self):
all_protos = creation.get_all_op_protos()
self.assertNotEqual(0, len(all_protos))
for each in all_protos:
self.assertTrue(each.IsInitialized())
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册