提交 8dc382e4 编写于 作者: W wangmeng28

Check whether param name is manually set when input is a sequence in fc layer

上级 7d653216
...@@ -1044,6 +1044,8 @@ def fc_layer(input, ...@@ -1044,6 +1044,8 @@ def fc_layer(input,
if isinstance(param_attr, collections.Sequence): if isinstance(param_attr, collections.Sequence):
assert len(input) == len(param_attr) assert len(input) == len(param_attr)
else: else:
if "parameter_name" in param_attr.attr and len(input) > 1:
logger.fatal("You should set the parameter name for each of the input item.")
param_attr = [copy.deepcopy(param_attr) for _ in range(len(input))] param_attr = [copy.deepcopy(param_attr) for _ in range(len(input))]
assert isinstance(input, collections.Sequence) assert isinstance(input, collections.Sequence)
...@@ -4863,6 +4865,8 @@ def selective_fc_layer(input, ...@@ -4863,6 +4865,8 @@ def selective_fc_layer(input,
if isinstance(param_attr, collections.Sequence): if isinstance(param_attr, collections.Sequence):
assert len(input) == len(param_attr) assert len(input) == len(param_attr)
else: else:
if "parameter_name" in param_attr.attr and len(input) > 1:
logger.fatal("You should set the parameter name for each of the input item.")
param_attr = [copy.deepcopy(param_attr) for _ in range(len(input))] param_attr = [copy.deepcopy(param_attr) for _ in range(len(input))]
assert isinstance(input, collections.Sequence) assert isinstance(input, collections.Sequence)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册