latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.nn.attention.create_mask
- tensorplay.nn.attention.create_mask(mod_fn: _score_mod_signature | _mask_mod_signature, B: int | None, H: int | None, Q_LEN: int, KV_LEN: int, device: DeviceLikeType | None = None) Tensor[source]
This function creates a mask tensor from a mod_fn function.
- Parameters:
- Returns:
A mask tensor with shape (B, H, M, N).
- Return type:
mask (Tensor)
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

