MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _get_fake_input_shape

Function _get_fake_input_shape

monai/bundle/scripts.py:1145–1155  ·  view source on GitHub ↗

Get a fake input shape e.g. [N, C, H, W] or [N, C, H, W, D], whose batch size is 1, from the given parser. Args: parser: a ConfigParser which contains the i/o information of a bundle.

(parser: ConfigParser)

Source from the content-addressed store, hash-verified

1143
1144
1145def _get_fake_input_shape(parser: ConfigParser) -> tuple:
1146 """
1147 Get a fake input shape e.g. [N, C, H, W] or [N, C, H, W, D], whose batch size is 1, from the given parser.
1148
1149 Args:
1150 parser: a ConfigParser which contains the i/o information of a bundle.
1151 """
1152 input_channels, input_spatial_shape, _, _, _ = _get_net_io_info(parser=parser)
1153 spatial_shape = _get_fake_spatial_shape(input_spatial_shape)
1154 input_shape = (1, input_channels, *spatial_shape)
1155 return input_shape
1156
1157
1158def verify_net_in_out(

Callers 3

onnx_exportFunction · 0.85
ckpt_exportFunction · 0.85
trt_exportFunction · 0.85

Calls 2

_get_net_io_infoFunction · 0.85
_get_fake_spatial_shapeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…