class_docstr: CoordConv layer as in the paper.
  
  MIT License
  Copyright (c) 2018 Walsvid
  
  Link to the paper: https://arxiv.org/abs/1807.03247
  Link to the PyTorch implementation: https://github.com/walsvid/CoordConv
class_docstr_tok: ["CoordConv","layer","as","in","the","paper",".","MIT","License","Copyright","(","c",")","2018","Walsvid","Link","to","the","paper",":","https",":","\/\/arxiv.org\/abs\/1807.03247","Link","to","the","PyTorch","implementation",":","https",":","\/\/github.com\/walsvid\/CoordConv"]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      kernel_size: _size_2_t,
      stride: _size_2_t = 1,
      padding: str | _size_2_t = 0,
      dilation: _size_2_t = 1,
      groups: int = 1,
      bias: bool = True,
      with_r: bool = False,
  ) -> None:
      super().__init__(
          in_channels=in_channels,
          out_channels=out_channels,
          kernel_size=kernel_size,
          stride=stride,
          padding=padding,
          dilation=dilation,
          groups=groups,
          bias=bias,
      )
      # AddCoord layer.
      self.add_coords = AddCoords(with_r)
  
      # Create conv layer on top of add_coords layer.
      self.conv2d = nn.Conv2d(
          in_channels=in_channels
          + 2
          + int(with_r),  # 2 for rank-2 tensor, 1 for r if with_r
          out_channels=out_channels,
          kernel_size=kernel_size,
          stride=stride,
          padding=padding,
          dilation=dilation,
          groups=groups,
          bias=bias,
      )
  
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  import torchvision
  from einops import rearrange
  from sklearn.cluster import KMeans
  from torch import Tensor, nn
  from torch.fx.graph_module import GraphModule
  from torch.nn.common_types import _size_2_t
  from torch.utils.data import DataLoader
  from torchvision.models.feature_extraction import create_feature_extractor
  from tqdm import tqdm
  from anomalib.models.cfa.anomaly_map import AnomalyMapGenerator
  from anomalib.models.components import DynamicBufferModule
  from anomalib.models.components.feature_extractors import dryrun_find_featuremap_dims
label_desc: Use image node_id 1 to create a new CoordConv2d object from inherited base classes: nn with example: obj = CoordConv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias, with_r)