Skip to content

InstanceNorm1D extra_repr 有问题 #38532

Closed
@yt605155624

Description

@yt605155624

如下图所示
image
_InstanceNormBase 的 self.scale 可以为 None 的,但是如果其他报错栈需要调用 extra_repr() 这个函数,就会报错 AttributeError: 'NoneType' object has no attribute 'shape'
因为在 extra_repr() 里面要打印 self.scale.shape[0], 那当 self.scale 为 None 时就会报错
复现对齐需要,此处 self.scale 必须为 None, 报错是调用 remove_weight_norm() 的时候 InstanceNorm1D 的对象由于没有 wight_norm , 可能就调用了 extra_repr(),然后报错

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions