MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / __init__

Method __init__

src/shape_assembly/models/train/transformer.py:80–85  ·  view source on GitHub ↗
(self, size, self_attn, feed_forward)

Source from the content-addressed store, hash-verified

78
79class EncoderLayer(pl.LightningModule):
80 def __init__(self, size, self_attn, feed_forward):
81 super(EncoderLayer, self).__init__()
82 self.self_attn = self_attn
83 self.feed_forward = feed_forward
84 self.sublayer = clones(SublayerConnection(size), 2)
85 self.size = size
86
87 def forward(self, x, mask):
88 x = self.sublayer[0](x, lambda x: self.self_attn(x, x, x, mask))

Callers

nothing calls this directly

Calls 3

clonesFunction · 0.85
SublayerConnectionClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected