MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / shape

Method shape

imperative/python/megengine/utils/network_node.py:112–124  ·  view source on GitHub ↗

r"""Return the symbolic shape if using set_symbolic_shape(True) else inferred shape

(self)

Source from the content-addressed store, hash-verified

110
111 @property
112 def shape(self):
113 r"""Return the symbolic shape if using set_symbolic_shape(True)
114 else inferred shape
115 """
116 rst = None
117 if self.var:
118 try:
119 rst = self.var.shape
120 except:
121 rst = None
122 if not use_symbolic_shape():
123 return rst
124 return self._get_var_shape() if self.var else None
125
126 def __bool__(self):
127 return False

Callers 1

fold_weight_biasMethod · 0.45

Calls 2

_get_var_shapeMethod · 0.95
use_symbolic_shapeFunction · 0.85

Tested by

no test coverage detected