mirror of https://github.com/hpcaitech/ColossalAI
[fx] added ndim property to proxy (#1253)
parent
4a09fc0947
commit
fb35460595
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue