Be able to pass non-scalar tensors through from validation_step to validation_end
🚀 Feature
Currently, upon collation of validation steps, there is a line which does tensor = tensor.item() (trainer/logging.py line 90-93). This is not good news if the tensor is not a scalar / rank-0 tensor. The solution could be to simply change to tensor.detach() if the goal is to just detach the computational graph.
        for k, v in callback_metrics.items():
            if isinstance(v, torch.Tensor):
                callback_metrics[k] = v.item()