promptdojo_

Tensors and shapes before anything else — step 6 of 7

Write shape(t) (walk the nesting, tuple of lengths) and is_ragged(matrix) (True if any row's length differs from the first row's). Print both tensors' shape and ragged flag on one line each. shape() trusts the first element — is_ragged is the check that keeps that trust honest, because a ragged list is NOT a tensor and torch.tensor() would reject it.

full-screen editor opens — close anytime to keep reading.