code: def test_magnitude_hyst(self, device, dtype):
      inp = torch.tensor(
          [
              [
                  [
                      [0.5, 0.4, 0.5, 0.45, 0.1],
                      [0.3, 0.2, 0.3, 0.0, 0.3],
                      [0.5, 1.0, 1.0, 0.6, 0.75],
                      [0.2, 0.4, 0.6, 0.0, 0.5],
                      [0.1, 0.35, 0.35, 0.26, 0.1],
                  ]
              ]
          ],
          device=device,
          dtype=dtype,
      )
  
      expected_magnitude = torch.tensor(
          [
              [
                  [
                      [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                      [0.4858, 0.5594, 0.6878, 0.6977, 0.5602],
                      [0.1129, 0.0000, 0.0000, 0.4531, 0.0000],
                      [0.6115, 0.5859, 0.6110, 0.6766, 0.5160],
                      [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                  ]
              ]
          ],
          device=device,
          dtype=dtype,
      )
  
      expected_edges = torch.tensor(
          [
              [
                  [
                      [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                      [1.0000, 1.0000, 1.0000, 1.0000, 1.0000],
                      [1.0000, 0.0000, 0.0000, 1.0000, 0.0000],
                      [1.0000, 1.0000, 1.0000, 1.0000, 1.0000],
                      [0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
                  ]
              ]
          ],
          device=device,
          dtype=dtype,
      )
  
      magnitude, edges = canny(inp, hysteresis=True)
  
      self.assert_close(
          magnitude, expected_magnitude, atol=1e-4, rtol=1e-4
      )
      self.assert_close(edges, expected_edges, atol=1e-4, rtol=1e-4)
  
file_path: kornia/test/filters/test_canny.py
imports: import pytest
  import torch
  from kornia.filters import Canny, canny
  from kornia.testing import BaseTester, tensor_to_gradcheck_var
  from kornia.utils._compat import torch_version
label_desc: Use image node_id 6 for calling the TestCanny obj's underlying member method code with example usage: obj.test_magnitude_hyst(device, dtype) without return types