besskge.embedding.refactor_embedding_sharding

besskge.embedding.refactor_embedding_sharding(entity_embedding, old_sharding, new_sharding)[source]

Refactor sharded entity embedding table to pass from one entity sharding to a different one.

Parameters:
  • entity_embedding (Parameter) – shape: (n_shard_old, max_ent_per_shard_old, row_size) Entity embedding table sharded according to old_sharding.

  • old_sharding (Sharding) – The current entity sharding.

  • new_sharding (Sharding) – The new entity sharding.

Return type:

Parameter

Returns:

shape: (n_shard_new, max_ent_per_shard_new, row_size) The refactored entity embedding table, sharded according to new_sharding.