mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-01 17:17:05 +00:00
[Tensor] init a tp network training unittest (#849)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from numpy import product
|
||||
from .op_wrapper import _COLOSSAL_OPS
|
||||
|
||||
import torch
|
||||
from typing import Tuple, Optional
|
||||
from .op_wrapper import _COLOSSAL_OPS
|
||||
from numpy import product
|
||||
|
||||
|
||||
class ColoTensor(object):
|
||||
""" Data Structure for Tensor in Colossal-AI
|
||||
@@ -52,7 +54,6 @@ class ColoTensor(object):
|
||||
return product(self._size)
|
||||
|
||||
@staticmethod
|
||||
|
||||
def init_from_torch_tensor(tensor: torch.Tensor, save_payload=True) -> 'ColoTensor':
|
||||
colo_t = ColoTensor(*tensor.size(),
|
||||
dtype=tensor.dtype,
|
||||
|
Reference in New Issue
Block a user