A simple structure that contains basic shape specification about a tensor. It is often used as the auxiliary inputs/outputs of models, to complement the lack of shape inference ability among pytorch modules. Attributes: channels: height: width: strid
| 51 | |
| 52 | |
| 53 | class ShapeSpec(namedtuple("_ShapeSpec", ["channels", "height", "width", "stride"])): |
| 54 | """ |
| 55 | A simple structure that contains basic shape specification about a tensor. |
| 56 | It is often used as the auxiliary inputs/outputs of models, |
| 57 | to complement the lack of shape inference ability among pytorch modules. |
| 58 | |
| 59 | Attributes: |
| 60 | channels: |
| 61 | height: |
| 62 | width: |
| 63 | stride: |
| 64 | """ |
| 65 | |
| 66 | def __new__(cls, channels=None, height=None, width=None, stride=None): |
| 67 | return super().__new__(cls, channels, height, width, stride) |
| 68 | |
| 69 | |
| 70 | def get_norm(norm, out_channels): # todo: replace with syncbn |