MCPcopy Create free account
hub / github.com/AI-Hypercomputer/maxtext / get_data

Method get_data

tests/maxengine_test.py:69–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67 return config
68
69 def get_data(self):
70 s = (self.cfg.global_batch_size_to_train_on, self.cfg.max_target_length)
71 ids = jax.random.randint(self.rng, s, 0, self.cfg.vocab_size)
72
73 decoder_segment_ids = jax.numpy.zeros(s) + DECODING_ACTIVE_SEQUENCE_INDICATOR
74 decoder_positions = jnp.stack(
75 [jnp.arange(self.cfg.max_target_length, dtype=jnp.int32) for _ in range(self.cfg.global_batch_size_to_train_on)]
76 )
77
78 return ids, decoder_segment_ids, decoder_positions
79
80 def test_stack_and_unstack_prefill_cache(self):
81 config = pyconfig.initialize(

Callers 2

test_basic_prefillMethod · 0.95
test_basic_decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected