MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / causal_mask

Function causal_mask

data/data_utils.py:11–12  ·  view source on GitHub ↗
(b, h, q_idx, kv_idx)

Source from the content-addressed store, hash-verified

9
10def create_sparse_mask(document_lens, split_lens, attn_modes, device):
11 def causal_mask(b, h, q_idx, kv_idx):
12 return q_idx >= kv_idx
13
14 def full_and_noise_mask(b, h, q_idx, kv_idx):
15 return (full_and_noise_seq_id[q_idx] == full_and_noise_seq_id[kv_idx]) & (full_and_noise_seq_id[q_idx] >= 0)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected