MCPcopy Create free account
hub / github.com/google-research/language / dummy_input

Method dummy_input

language/mentionmemory/tasks/mauto_task.py:321–347  ·  view source on GitHub ↗

Produces model-specific dummy input batch. See BaseTask.

(config: ml_collections.ConfigDict)

Source from the content-addressed store, hash-verified

319
320 @staticmethod
321 def dummy_input(config: ml_collections.ConfigDict) -> Dict[str, Any]:
322 """Produces model-specific dummy input batch. See BaseTask."""
323
324 dummy_input = mention_memory_task.MentionMemoryTask.dummy_input(config)
325 encoder_config = config.model_config.encoder_config
326 float_type = encoder_config.dtype
327 int_type = jnp.int32
328 mention_retrieval_shape = (config.max_retrieval_indices)
329 retrieval_mention_values = np.ones(
330 (config.max_retrieval_indices, encoder_config.retrieval_dim))
331 mauto_dummy_dict = {
332 'retrieval_mention_values':
333 jnp.asarray(retrieval_mention_values, float_type),
334 'retrieval_mention_scores':
335 jnp.ones(mention_retrieval_shape, float_type),
336 'retrieval_mention_mask':
337 jnp.ones(mention_retrieval_shape, int_type),
338 'retrieval_mention_batch_positions':
339 jnp.ones(mention_retrieval_shape, int_type),
340 'retrieval_mention_start_positions':
341 jnp.ones(mention_retrieval_shape, int_type),
342 'retrieval_mention_end_positions':
343 jnp.ones(mention_retrieval_shape, int_type),
344 }
345 dummy_input.update(mauto_dummy_dict)
346
347 return dummy_input

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected