def _preprocess(self, img: "torch.Tensor") -> "torch.Tensor":
        """
        Preprocess image before forward pass, this is the same preprocessing used during training, please refer to
        collate function in train.py for reference

        :param img: Single frame od shape (nb_samples, height, width, nb_channels).
        :return: Preprocessed frame.
        """
        import torch
        from torch.nn.functional import interpolate

        from art.preprocessing.standardisation_mean_std.pytorch import StandardisationMeanStdPyTorch

        if self.preprocessing is not None and isinstance(self.preprocessing, StandardisationMeanStdPyTorch):
            mean_np = self.preprocessing.mean
            std_np = self.preprocessing.std
        else:
            mean_np = np.ones(shape=(3, 1, 1), dtype=float)
            std_np = np.ones(shape=(3, 1, 1), dtype=float)
        mean = torch.from_numpy(mean_np).reshape((3, 1, 1))
        std = torch.from_numpy(std_np).reshape((3, 1, 1))
        img = img.permute(2, 0, 1)
        img = img * std + mean
        img = torch.unsqueeze(img, dim=0)
        img = interpolate(img, size=(self.input_shape[1], self.input_shape[2]), mode="bicubic")
        if self.clip_values is not None:
            img = torch.clamp(img, float(self.clip_values[0]), float(self.clip_values[1]))
        img = torch.squeeze(img)
        img = (img - mean) / std
        return img

        Preprocess image before forward pass, this is the same preprocessing used during training, please refer to
        collate function in train.py for reference

        :param img: Single frame od shape (nb_samples, height, width, nb_channels).
        :return: Preprocessed frame.
        
art/estimators/object_tracking/pytorch_goturn.py