MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _normalize_shape_spec

Function _normalize_shape_spec

deepspeed/module_inject/layers.py:1922–1927  ·  view source on GitHub ↗
(shape)

Source from the content-addressed store, hash-verified

1920
1921
1922def _normalize_shape_spec(shape):
1923 if isinstance(shape, list):
1924 return tuple(_normalize_shape_spec(item) for item in shape)
1925 if isinstance(shape, tuple):
1926 return tuple(_normalize_shape_spec(item) if isinstance(item, list) else item for item in shape)
1927 return shape
1928
1929
1930def _infer_subparam_logical_shapes(weight_shape, shape, partition_dim, name=None):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected