def METHOD_NAME(model_retval: Any) -> int:
    count = 0
    def counter_fn(x: torch.Tensor) -> torch.Tensor:
        nonlocal count
        count += 1
        return x
    objwalk(model_retval, is_tensor, counter_fn)
    return count