Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
oahzxl committed Aug 14, 2023
1 parent c84f37b commit 00cb06e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion colossalai/nn/layer/moe/moe_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,13 @@ def is_moe_param(tensor: torch.Tensor) -> bool:
return hasattr(tensor, "moe_info")


def set_moe_param_info(tensor: torch.Tensor, moe_info: dict):
def set_moe_param_info(tensor: torch.Tensor, moe_info: dict) -> None:
"""
Set moe info for the given tensor.
Args:
tensor (torch.Tensor): The tensor to be set.
moe_info (dict): The moe info to be set.
"""
tensor.__setattr__('moe_info', moe_info)

0 comments on commit 00cb06e

Please sign in to comment.