parent
cd5113c197
commit
8da5587205
@ -0,0 +1,12 @@
|
||||
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
|
@ -1,2 +1,2 @@
|
||||
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)
|
||||
|
@ -0,0 +1,15 @@
|
||||
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()
|
Loading…
Reference in new issue