mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-16 06:30:41 +00:00
reorgnize colotensor directory (#1062)
* reorgnize colotensor directory * polish code
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from .utils import InsertPostInitMethodToModuleSubClasses
|
||||
import torch
|
||||
from colossalai.tensor import ColoTensor, ColoParameter, register_colo_module, init_colo_module, \
|
||||
from colossalai.tensor import ColoTensor, ColoParameter
|
||||
|
||||
from colossalai.nn import register_colo_module, init_colo_module, \
|
||||
ColoLinear, ColoEmbedding
|
||||
import types
|
||||
|
||||
from torch import nn
|
||||
from typing import Iterator, Tuple, Union, Optional
|
||||
from typing import Iterator, Tuple, Union
|
||||
|
||||
# find named_params includes replica
|
||||
|
||||
@@ -24,6 +25,7 @@ def _named_params_with_replica(
|
||||
name = mod_prefix + ('.' if mod_prefix else '') + name
|
||||
yield name, val
|
||||
|
||||
|
||||
def ColoModulize(module):
|
||||
"""
|
||||
Replacing the parameters() and named_parameters() with our customized ones
|
||||
|
Reference in New Issue
Block a user