code: def test_determinism_large(
      device, levy_area_approximation, return_U, return_A
  ):
      """
      Tests that a single Brownian motion deterministically produces the same results when queried at the same points.
  
      We first of all query it at lots of points (larger than its internal cache), and then re-query at the same set of
      points, and compare.
      """
      if device == gpu and not torch.cuda.is_available():
          pytest.skip(msg="CUDA not available.")
  
      ta, tb, bm = _setup(
          device, levy_area_approximation, (SMALL_BATCH_SIZE, D)
      )
      cache = {}
      for _ in range(LARGE_REPS):
          ta_ = torch.rand_like(ta)
          tb_ = torch.rand_like(tb)
          ta_, tb_ = min(ta_, tb_), max(ta_, tb_)
          val = bm(ta_, tb_, return_U=return_U, return_A=return_A)
          if torch.is_tensor(val):
              val = (val,)
          cache[ta_, tb_] = tuple(v.detach().clone() for v in val)
  
      cache2 = {}
      for ta_, tb_ in cache:
          val = bm(ta_, tb_, return_U=return_U, return_A=return_A)
          if torch.is_tensor(val):
              val = (val,)
          cache2[ta_, tb_] = tuple(v.detach().clone() for v in val)
  
      for ta_, tb_ in cache:
          for v1, v2 in zip(cache[ta_, tb_], cache2[ta_, tb_]):
              assert (v1 == v2).all()
  
file_path: torchsde/tests/test_brownian_interval.py
imports: import sys
  import math
  import numpy.random
  import torch
  from scipy.stats import kstest
  import pytest
  import torchsde
label_desc: Use image node_id 6 for calling a global function with example usage: test_determinism_large(device, levy_area_approximation, return_U, return_A) without return types