mirror of https://github.com/hpcaitech/ColossalAI
[hotfix[ fix colotensor.type() raise NotImplementedError (#1682)
parent
3b2a59b0ba
commit
e5ab6be72e
|
@ -18,6 +18,8 @@ def register_elementwise_op(op):
|
||||||
|
|
||||||
output = op(input_tensor, *args, **kwargs)
|
output = op(input_tensor, *args, **kwargs)
|
||||||
if isinstance(input_tensor, ColoTensor):
|
if isinstance(input_tensor, ColoTensor):
|
||||||
|
if isinstance(output, str):
|
||||||
|
return output
|
||||||
if not isinstance(output, torch.Tensor):
|
if not isinstance(output, torch.Tensor):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
return ColoTensor.from_torch_tensor(output,
|
return ColoTensor.from_torch_tensor(output,
|
||||||
|
|
Loading…
Reference in New Issue