MCPcopy Create free account
hub / github.com/RL-Align/RL-Kernel / _inputs

Function _inputs

tests/test_stateless_executor.py:80–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78
79
80def _inputs() -> StatelessForwardInputs:
81 input_ids = torch.tensor(
82 [
83 [0, 1, 2, 3, 0],
84 [0, 2, 1, 4, 5],
85 ],
86 dtype=torch.long,
87 )
88 attention_mask = torch.tensor(
89 [
90 [1, 1, 1, 1, 0],
91 [1, 1, 1, 1, 1],
92 ],
93 dtype=torch.bool,
94 )
95 completion_mask = torch.tensor(
96 [
97 [False, False, True, True, False],
98 [False, False, True, True, True],
99 ]
100 )
101 return StatelessForwardInputs(
102 input_ids=input_ids,
103 attention_mask=attention_mask,
104 completion_mask=completion_mask,
105 )
106
107
108def _logits_for(inputs: StatelessForwardInputs, vocab_size: int = 8) -> torch.Tensor:

Calls 1

Tested by

no test coverage detected