class_docstr: Class implementing a convolutional layer in the interval/box domain.
class_docstr_tok: ["Class","implementing","a","convolutional","layer","in","the","interval\/box","domain","."]
docstr: Performs the forward pass of the convolutional layer in the interval (box) domain by using
  the equivalent dense representation.
  
  :param x: interval representation of the datapoint.
  :return: output of the convolutional layer on x
docstr_tok: ["Performs","the","forward","pass","of","the","convolutional","layer","in","the","interval","(","box",")","domain","by","using","the","equivalent","dense","representation",".",":","param","x",":","interval","representation","of","the","datapoint",".",":","return",":","output","of","the","convolutional","layer","on","x"]
code: def forward(self, x: "torch.Tensor") -> "torch.Tensor":
      """
      Performs the forward pass of the convolutional layer in the interval (box) domain by using
      the equivalent dense representation.
  
      :param x: interval representation of the datapoint.
      :return: output of the convolutional layer on x
      """
      x = torch.reshape(x, (x.shape[0], 2, -1))
  
      center = (x[:, 1] + x[:, 0]) / 2
      radius = (x[:, 1] - x[:, 0]) / 2
  
      center = (
          torch.matmul(
              center, torch.transpose(self.dense_weights, 0, 1)
          )
          + self.bias
      )
      radius = torch.matmul(
          radius, torch.abs(torch.transpose(self.dense_weights, 0, 1))
      )
  
      center = torch.unsqueeze(center, dim=1)
      radius = torch.unsqueeze(radius, dim=1)
  
      x = torch.cat([center - radius, center + radius], dim=1)
      return x.reshape(
          (
              -1,
              2,
              self.out_channels,
              self.output_height,
              self.output_width,
          )
      )
  
imports: from typing import List, Union, Tuple, Optional
  import torch
  import numpy
label_desc: Use image node_id 4 for calling the PyTorchIntervalConv2D obj's underlying member method code with example usage: obj.forward(x) and returns: x