[fx] added ndim property to proxy (#1253)

pull/1271/head
Frank Lee 2022-07-12 15:27:13 +08:00 committed by GitHub
parent 4a09fc0947
commit fb35460595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ class ColoProxy(Proxy):
self._assert_meta_data_is_tensor() self._assert_meta_data_is_tensor()
return self.meta_data.shape return self.meta_data.shape
@property
def ndim(self):
return self.dim()
def dim(self): def dim(self):
self._assert_meta_data_is_tensor() self._assert_meta_data_is_tensor()
return self.meta_data.dim() return self.meta_data.dim()