code: def test_normality(device):
      if device == gpu and not torch.cuda.is_available():
          pytest.skip(msg="CUDA not available.")
  
      t0_, t1_ = 0.0, 1.0
      t0, t1 = torch.tensor([t0_, t1_], device=device)
      eps = 1e-5
      for _ in range(REPS):
          w0_, w1_ = 0.0, npr.randn()
          w0 = torch.tensor(w0_, device=device).repeat(LARGE_BATCH_SIZE)
          w1 = torch.tensor(w1_, device=device).repeat(LARGE_BATCH_SIZE)
          bm = torchsde.BrownianTree(
              t0=t0, t1=t1, w0=w0, w1=w1, pool_size=100, tol=1e-14
          )  # noqa
  
          for _ in range(REPS):
              t_ = npr.uniform(low=t0_ + eps, high=t1_ - eps)
              samples = bm(t_)
              samples_ = samples.cpu().detach().numpy()
  
              mean_ = ((t1_ - t_) * w0_ + (t_ - t0_) * w1_) / (
                  t1_ - t0_
              )
              std_ = np.sqrt((t1_ - t_) * (t_ - t0_) / (t1_ - t0_))
              ref_dist = norm(loc=mean_, scale=std_)
  
              _, pval = kstest(samples_, ref_dist.cdf)
              assert pval >= ALPHA
  
file_path: torchsde/tests/test_brownian_tree.py
imports: import sys
  import numpy
  import numpy.random
  import torch
  from scipy.stats import norm, kstest
  import pytest
  import torchsde
label_desc: Use image node_id 5 for calling a global function with example usage: test_normality(device) without return types