mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-04-12 15:14:55 +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
21 lines
707 B
Python
21 lines
707 B
Python
import torch
|
|
|
|
from ...registry import meta_patched_function
|
|
|
|
|
|
@meta_patched_function.register(torch.nn.functional.layer_norm)
|
|
def torch_nn_func_layernorm(input, normalized_shape, weight=None, bias=None, eps=1e-05):
|
|
return torch.empty(input.shape, device='meta')
|
|
|
|
|
|
@meta_patched_function.register(torch.nn.functional.batch_norm)
|
|
def torch_nn_func_batchnorm(input,
|
|
running_mean,
|
|
running_var,
|
|
weight=None,
|
|
bias=None,
|
|
training=False,
|
|
momentum=0.1,
|
|
eps=1e-05):
|
|
return torch.empty(input.shape, device='meta')
|