From 892f9ea0db18d1bef81ea45221f53745c03509f5 Mon Sep 17 00:00:00 2001 From: Erfan Zekri Esfahani <40582518+eze1376@users.noreply.github.com> Date: Sun, 13 Aug 2023 20:56:40 +0330 Subject: [PATCH] import required torch and numpy libraries (#25483) --- docs/source/en/tasks/semantic_segmentation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/en/tasks/semantic_segmentation.md b/docs/source/en/tasks/semantic_segmentation.md index 267d0083b..6bb25e3e2 100644 --- a/docs/source/en/tasks/semantic_segmentation.md +++ b/docs/source/en/tasks/semantic_segmentation.md @@ -221,6 +221,10 @@ logits first, and then reshaped to match the size of the labels before you can c ```py +>>> import numpy as np +>>> import torch +>>> from torch import nn + >>> def compute_metrics(eval_pred): ... with torch.no_grad(): ... logits, labels = eval_pred