class_docstr: TfAvgPool3D
class_docstr_tok: ["TfAvgPool3D"]
code: def forward(self, x: Tensor) -> Tensor:
      if x.shape[-1] != x.shape[-2]:
          raise RuntimeError(
              "only same shape for h and w "
              + "are supported by avg with tf_like"
          )
      if x.shape[-1] != x.shape[-2]:
          raise RuntimeError(
              "only same shape for h and w "
              + "are supported by avg with tf_like"
          )
      f1 = x.shape[-1] % 2 != 0
      if f1:
          padding_pad = (0, 0, 0, 0)
      else:
          padding_pad = (0, 1, 0, 1)
      x = torch.nn.functional.pad(x, padding_pad)
      if f1:
          x = torch.nn.functional.avg_pool3d(
              x,
              (1, 3, 3),
              stride=(1, 2, 2),
              count_include_pad=False,
              padding=(0, 1, 1),
          )
      else:
          x = self.avgf(x)
          x[..., -1] = x[..., -1] * 9 / 6
          x[..., -1, :] = x[..., -1, :] * 9 / 6
      return x
  
imports: import torch
  from torch import nn, Tensor
label_desc: Use image node_id 2 for calling the TfAvgPool3D obj's underlying member method code with example usage: obj.forward(x) and returns: x