MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

utils/masking.py:27–30  ·  view source on GitHub ↗
(self, B, L, device="cpu")

Source from the content-addressed store, hash-verified

25
26class TriangularCausalMask():
27 def __init__(self, B, L, device="cpu"):
28 mask_shape = [B, 1, L, L]
29 with torch.no_grad():
30 self._mask = torch.triu(torch.ones(mask_shape, dtype=torch.bool), diagonal=1).to(device)
31
32 @property
33 def mask(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected