code: def test_seminorm(self):
      for dtype in DTYPES:
          for device in DEVICES:
              for method in ADAPTIVE_METHODS:
                  with self.subTest(
                      dtype=dtype, device=device, method=method
                  ):
                      if dtype == torch.float64:
                          tol = 1e-8
                      else:
                          tol = 1e-6
  
                      x0 = torch.tensor(
                          [1.0, 2.0], device=device, dtype=dtype
                      )
                      t = torch.tensor(
                          [0.0, 1.0], device=device, dtype=torch.float64
                      )
  
                      ode_f = _NeuralF(width=1024, oscillate=True).to(
                          device, dtype
                      )
  
                      out = torchdiffeq.odeint_adjoint(
                          ode_f,
                          x0,
                          t,
                          atol=tol,
                          rtol=tol,
                          method=method,
                      )
                      ode_f.nfe = 0
                      out.sum().backward()
                      default_nfe = ode_f.nfe
  
                      out = torchdiffeq.odeint_adjoint(
                          ode_f,
                          x0,
                          t,
                          atol=tol,
                          rtol=tol,
                          method=method,
                          adjoint_options=dict(norm="seminorm"),
                      )
                      ode_f.nfe = 0
                      out.sum().backward()
                      seminorm_nfe = ode_f.nfe
  
                      self.assertLessEqual(seminorm_nfe, default_nfe)
  
file_path: torchdiffeq/tests/norm_tests.py
imports: import contextlib
  import unittest
  import torch
  import torchdiffeq
  from problems import DTYPES, DEVICES, ADAPTIVE_METHODS
label_desc: Use image node_id 4 for calling the TestNorms obj's underlying member method code with example usage: obj.test_seminorm() without return types