(x)
| 432 | depth = len(list(model.sublayers())) |
| 433 | |
| 434 | def _get_shape_from_tensor(x): |
| 435 | if isinstance(x, (paddle.base.Variable, paddle.base.core.eager.Tensor)): |
| 436 | return list(x.shape) |
| 437 | elif isinstance(x, (list, tuple)): |
| 438 | return [_get_shape_from_tensor(xx) for xx in x] |
| 439 | |
| 440 | def _get_output_shape(output): |
| 441 | if isinstance(output, (list, tuple)): |