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

Function clones

src/shape_assembly/models/train/transformer.py:8–9  ·  view source on GitHub ↗
(module, N)

Source from the content-addressed store, hash-verified

6import pytorch_lightning as pl
7
8def clones(module, N):
9 return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])
10
11def attention(query, key, value, mask=None):
12 d_k = query.size(-1)

Callers 5

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected