MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / get_linear_layer

Function get_linear_layer

codegeex/megatron/model/utils.py:47–53  ·  view source on GitHub ↗

Simple linear layer with weight initialization.

(rows, columns, init_method)

Source from the content-addressed store, hash-verified

45
46
47def get_linear_layer(rows, columns, init_method):
48 """Simple linear layer with weight initialization."""
49 layer = torch.nn.Linear(rows, columns)
50 init_method(layer.weight)
51 with torch.no_grad():
52 layer.bias.zero_()
53 return layer
54
55
56def fast_gelu(x):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected