Skip to content

Commit 77b8270

Browse files
authored
add ndim property to internal descriptor (#739)
1 parent 84fecbb commit 77b8270

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dpnp/dpnp_utils/dpnp_algo_utils.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ cdef class dpnp_descriptor:
475475
return self.descriptor["shape"]
476476
return None
477477

478+
@property
479+
def ndim(self):
480+
if self.is_valid:
481+
return len(self.shape)
482+
return 0
483+
478484
@property
479485
def size(self):
480486
if self.is_valid:

0 commit comments

Comments
 (0)