code: def test_lc_3d(
      self, N, C, T, H, W, M, kernel, op_name, use_bias, gc, dc
  ):
      if T < kernel:
          kernel = T
      if H < kernel:
          kernel = H
      if W < kernel:
          kernel = W
  
      op = core.CreateOperator(
          op_name,
          ["X", "W", "b"] if use_bias else ["X", "W"],
          ["Y"],
          kernels=[kernel, kernel, kernel],
          order="NCHW",
          engine="",
      )
  
      Y_T = T - kernel + 1
      Y_H = H - kernel + 1
      Y_W = W - kernel + 1
      X = np.random.rand(N, C, T, H, W).astype(np.float32) - 0.5
      W = (
          np.random.rand(
              Y_T, Y_H, Y_W, M, C, kernel, kernel, kernel
          ).astype(np.float32)
          - 0.5
      )
      b = np.random.rand(Y_T, Y_H, Y_W, M).astype(np.float32) - 0.5
      inputs = [X, W, b] if use_bias else [X, W]
  
      def lc_3d_nchw(X, W, b=None):
          N, C, XT, XH, XW = X.shape
          YT, YH, YW, M, _, KT, KH, KW = W.shape
  
          def conv(n, m, yt, yh, yw):
              sum = b[yt, yh, yw, m] if b is not None else 0
              for c in range(C):
                  for kt in range(KT):
                      for kh in range(KH):
                          for kw in range(KW):
                              tt = yt + kt
                              hh = yh + kh
                              ww = yw + kw
                              sum += (
                                  X[n, c, tt, hh, ww]
                                  * W[yt, yh, yw, m, c, kt, kh, kw]
                              )
              return sum
  
          output = np.zeros((N, M, YT, YH, YW), dtype=np.float32)
          for n in range(N):
              for m in range(M):
                  for yt in range(YT):
                      for yh in range(YH):
                          for yw in range(YW):
                              output[n, m, yt, yh, yw] = conv(
                                  n, m, yt, yh, yw
                              )
          return [output]
  
      self.assertReferenceChecks(
          device_option=gc,
          op=op,
          inputs=inputs,
          reference=lc_3d_nchw,
      )
      self.assertDeviceChecks(dc, op, inputs, [0])
      for i in range(len(inputs)):
          self.assertGradientChecks(gc, op, inputs, i, [0])
  
file_path: pytorch/caffe2/python/operator_test/locally_connected_op_test.py
imports: import numpy
  from hypothesis import given, settings, assume
  import hypothesis.strategies
  from caffe2.python import core, utils, workspace
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
label_desc: Use image node_id 3 for calling the TestLocallyConnectedOp obj's underlying member method code with example usage: obj.test_lc_3d(N, C, T, H, W, M, kernel, op_name, use_bias, gc, dc) and returns: list, sum