MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / get_linear_layer

Function get_linear_layer

DeepSpeedExample/megatron/model/utils.py:43–49  ·  view source on GitHub ↗

Simple linear layer with weight initialization.

(rows, columns, init_method)

Source from the content-addressed store, hash-verified

41
42
43def get_linear_layer(rows, columns, init_method):
44 """Simple linear layer with weight initialization."""
45 layer = torch.nn.Linear(rows, columns)
46 init_method(layer.weight)
47 with torch.no_grad():
48 layer.bias.zero_()
49 return layer
50
51@torch.jit.script
52def gelu_impl(x):

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