(pyval)
| 433 | """Returns a Shape that describes a tuple-tree of Numpy arrays.""" |
| 434 | |
| 435 | def convert(pyval): |
| 436 | if isinstance(pyval, tuple): |
| 437 | return Shape.tuple_shape(tuple(convert(elt) for elt in pyval)) |
| 438 | else: |
| 439 | return Shape.array_shape(pyval.dtype, np.shape(pyval)) |
| 440 | |
| 441 | return convert(pyval) |
| 442 |