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

This commit is contained in:
Frank Lee
2022-07-12 15:27:13 +08:00
committed by GitHub
parent 4a09fc0947
commit fb35460595

View File

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