code: def test_edges(self, device, dtype):
      inp = torch.tensor(
          [
              [
                  [
                      [
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 1.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                      ],
                      [
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 1.0, 0.0, 0.0],
                          [0.0, 1.0, 1.0, 1.0, 0.0],
                          [0.0, 0.0, 1.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                      ],
                      [
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 1.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0, 0.0, 0.0],
                      ],
                  ]
              ]
          ],
          device=device,
          dtype=dtype,
      )
  
      expected = torch.tensor(
          [
              [
                  [
                      [
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.5000, 0.0000, -0.5000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.5000, 0.0000, -0.5000, 0.0000],
                              [
                                  0.5000,
                                  0.5000,
                                  0.0000,
                                  -0.5000,
                                  -0.5000,
                              ],
                              [0.0000, 0.5000, 0.0000, -0.5000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.5000, 0.0000, -0.5000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                      ],
                      [
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.5000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, -0.5000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                          [
                              [0.0000, 0.0000, 0.5000, 0.0000, 0.0000],
                              [0.0000, 0.5000, 0.5000, 0.5000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [
                                  0.0000,
                                  -0.5000,
                                  -0.5000,
                                  -0.5000,
                                  0.0000,
                              ],
                              [0.0000, 0.0000, -0.5000, 0.0000, 0.0000],
                          ],
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.5000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, -0.5000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                      ],
                      [
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.5000, 0.0000, 0.0000],
                              [0.0000, 0.5000, 0.0000, 0.5000, 0.0000],
                              [0.0000, 0.0000, 0.5000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                          [
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                              [0.0000, 0.0000, -0.5000, 0.0000, 0.0000],
                              [
                                  0.0000,
                                  -0.5000,
                                  0.0000,
                                  -0.5000,
                                  0.0000,
                              ],
                              [0.0000, 0.0000, -0.5000, 0.0000, 0.0000],
                              [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                          ],
                      ],
                  ]
              ]
          ],
          device=device,
          dtype=dtype,
      )
  
      edges = spatial_gradient3d(inp)
      self.assert_close(edges, expected)
  
imports: import pytest
  import torch
  from kornia.filters import Sobel, SpatialGradient, SpatialGradient3d, sobel, spatial_gradient, spatial_gradient3d
  from kornia.testing import BaseTester, tensor_to_gradcheck_var
label_desc: Use image node_id 4 for calling the TestSpatialGradient3d obj's underlying member method code with example usage: obj.test_edges(device, dtype) without return types