class_docstr: A striding layer for doing torch Conv2DTranspose operations.
  
  Using this layer before the 0-padding (on a 3D input "image") and before
  the actual ConvTranspose2d allows for a padding="same" behavior that matches
  100% that of a `tf.keras.layers.Conv2DTranspose` layer.
  
  Examples:
      Input image (4x4):
      A B C D
      E F G H
      I J K L
      M N O P
  
      Stride with stride=2 -> output image=(7x7)
      A 0 B 0 C 0 D
      0 0 0 0 0 0 0
      E 0 F 0 G 0 H
      0 0 0 0 0 0 0
      I 0 J 0 K 0 L
      0 0 0 0 0 0 0
      M 0 N 0 O 0 P
class_docstr_tok: ["A","striding","layer","for","doing","torch","Conv2DTranspose","operations",".","Using","this","layer","before","the","0-padding","(","on","a","3D","input","``","image","''",")","and","before","the","actual","ConvTranspose2d","allows","for","a","padding=","''","same","''","behavior","that","matches","100","%","that","of","a","`","tf.keras.layers.Conv2DTranspose","`","layer",".","Examples",":","Input","image","(","4x4",")",":","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Stride","with","stride=2","-",">","output","image=","(","7x7",")","A","0","B","0","C","0","D","0","0","0","0","0","0","0","E","0","F","0","G","0","H","0","0","0","0","0","0","0","I","0","J","0","K","0","L","0","0","0","0","0","0","0","M","0","N","0","O","0","P"]
code: def forward(self, x):
      # Repeat incoming image stride(w/h) times to match the strided output template.
      repeated_x = (
          x.repeat_interleave(self.stride_w, dim=-2).repeat_interleave(
              self.stride_h, dim=-1
          )
      )[:, :, : -(self.stride_w - 1), : -(self.stride_h - 1)]
      # Where `self.where_template` == 1.0 -> Use image pixel, otherwise use
      # zero filler value.
      return torch.where(self.where_template, repeated_x, self.zeros)
  
imports: from ray.rllib.utils.framework import try_import_torch
label_desc: Use image node_id 2 for calling the Stride2D obj's underlying member method code with example usage: obj.forward(x) and returns: torch