MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / get_fake_input

Method get_fake_input

models.py:36–59  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

34 head_size: int = gin.REQUIRED
35
36 def get_fake_input(self) -> dict[str, Any]:
37 fake_input_dict = super().get_fake_input()
38 b = self.task_config.batch_size
39 n = self.num_heads
40 h = self.head_size
41 fake_input_dict.update({
42 'dstate': tuple(
43 [{
44 'current_index': jnp.array([0] * b, dtype=jnp.int32),
45 'keys': jnp.zeros((b, 2048, n, h), dtype=jnp.bfloat16),
46 'values': jnp.zeros((b, 2048, n, h), dtype=jnp.bfloat16),
47 'recurrent_kvq': None,
48 'relative_position_bias': jnp.zeros(
49 (b, n, 1, 1024), dtype=jnp.bfloat16
50 ),
51 }]
52 * 12
53 ),
54 'eos': jnp.zeros([1024], dtype=jnp.bfloat16),
55 'mask': jnp.ones([1024], dtype=jnp.bfloat16),
56 'length': 1,
57 'temperature': 1.0,
58 })
59 return fake_input_dict
60
61 def __call__(self, inputs: ...) -> tuple[Any, dict[str, Any]]:
62 # Make sure this code is not used on untested cases.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected