mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-22 09:59:38 +00:00
* [autoparallel] refactor tracer to fix bias addition issue * [fx] support module with bias addition * create bias_addition_module * refactor file structure * polish code * fix unit test
10 lines
254 B
Python
10 lines
254 B
Python
import torch
|
|
|
|
from ...registry import meta_patched_module
|
|
|
|
|
|
@meta_patched_module.register(torch.nn.Embedding)
|
|
def torch_nn_embedding(self, input):
|
|
result_shape = input.shape + (self.embedding_dim,)
|
|
return torch.empty(result_shape, device='meta')
|