mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-08 04:24:47 +00:00
[fx] supported model tracing for huggingface bert (#1201)
* [fx] supported model tracing for huggingface bert * polish test
This commit is contained in:
@@ -59,7 +59,11 @@ class ColoProxy(Proxy):
|
||||
|
||||
def size(self, dim: int = None):
|
||||
self._assert_has_meta()
|
||||
return self.meta_tensor.size(dim=dim)
|
||||
if dim:
|
||||
return self.meta_tensor.size(dim=dim)
|
||||
else:
|
||||
# size(dim=None) will trigger runtime error for meta tensor
|
||||
return self.meta_tensor.size()
|
||||
|
||||
def __len__(self):
|
||||
self._assert_has_meta()
|
||||
|
Reference in New Issue
Block a user