mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-28 21:17:08 +00:00
8 lines
217 B
Python
8 lines
217 B
Python
import torch
|
|
from .registry import meta_patched_module
|
|
|
|
|
|
@meta_patched_module.register(torch.nn.Linear)
|
|
def torch_nn_linear(self, input):
|
|
return torch.empty(input.shape[:-1] + (self.out_features,), device="meta")
|