MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / encode

Method encode

tensorrt_llm/models/gemma/utils/modules.py:53–56  ·  view source on GitHub ↗
(self, x: jax.Array)

Source from the content-addressed store, hash-verified

51 )
52
53 def encode(self, x: jax.Array) -> jax.Array:
54 x = self.input_embedding_table[(x, )]
55 x *= jnp.sqrt(self.embed_dim).astype(x.dtype)
56 return x
57
58 def decode(self, x: jax.Array) -> jax.Array:
59 return jnp.dot(x, self.input_embedding_table.T)

Callers 15

_get_network_hashMethod · 0.45
_encodeMethod · 0.45
get_file_lockFunction · 0.45
get_hash_keyMethod · 0.45
_load_plugin_libFunction · 0.45
tok_encodeMethod · 0.45
_truncate_promptMethod · 0.45
done_generatorFunction · 0.45
create_logprobsFunction · 0.45
sampleMethod · 0.45
processMethod · 0.45

Calls 1

sqrtMethod · 0.80

Tested by

no test coverage detected