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

Method __init__

deepspeed/runtime/utils.py:1165–1170  ·  view source on GitHub ↗
(self, orig_layer, name="")

Source from the content-addressed store, hash-verified

1163class TLinear(torch.nn.Linear):
1164
1165 def __init__(self, orig_layer, name=""):
1166 self.name = name
1167 super().__init__(orig_layer.weight.shape[1], orig_layer.weight.shape[0], bias=(orig_layer.bias is not None))
1168 self.weight.data = transpose(orig_layer.weight.data)
1169 self.bias = orig_layer.bias
1170 self._fwd_func = self._fwd_bias_add if self.bias is not None else self._fwd
1171
1172 def _fwd(self, input):
1173 return F.linear(input, self.weight)

Callers 1

__init__Method · 0.45

Calls 1

transposeFunction · 0.50

Tested by

no test coverage detected