提交 40da8c00 编写于 作者: Y yuyang18

Add missing attr

上级 3923d409
...@@ -36,6 +36,12 @@ def randomize_probability(batch_size, class_num, dtype='float32'): ...@@ -36,6 +36,12 @@ def randomize_probability(batch_size, class_num, dtype='float32'):
def create_op(scope, op_type, inputs, outputs, attrs): def create_op(scope, op_type, inputs, outputs, attrs):
kwargs = dict() kwargs = dict()
op_maker = core.op_proto_and_checker_maker
op_role_attr_name = op_maker.kOpRoleAttrName()
if op_role_attr_name not in attrs:
attrs[op_role_attr_name] = int(op_maker.OpRole.Forward)
def __create_var__(name, var_name): def __create_var__(name, var_name):
scope.var(var_name).get_tensor() scope.var(var_name).get_tensor()
kwargs[name].append(var_name) kwargs[name].append(var_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册