Unverified Commit 1f7c04c9 authored by Arturo Ghinassi's avatar Arturo Ghinassi Committed by GitHub
Browse files

changed .float() to .as_type(self.weight)

AMP support
parent 2196b766
...@@ -70,7 +70,7 @@ class FMoELinear(nn.Module): ...@@ -70,7 +70,7 @@ class FMoELinear(nn.Module):
r""" r"""
Call MOE function Call MOE function
""" """
x = MOELinear.apply(inp.float(), fwd_expert_count, self.weight, self.bias) x = MOELinear.apply(inp.type_as(self.weight), fwd_expert_count, self.weight, self.bias)
return x return x
def extra_repr(self) -> str: def extra_repr(self) -> str:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment