MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / ShapeSpec

Class ShapeSpec

PATH/core/models/ops/utils.py:53–67  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

51
52
53class 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
70def get_norm(norm, out_channels): # todo: replace with syncbn

Callers 6

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected