code: def test_simple_symmetric():
      gamma = torch.Tensor([-1.0])
      slopes = torch.Tensor([[2.0, 2.0]])
      knot_spacings = torch.Tensor([[0.5, 0.5]])
  
      distr = PiecewiseLinear(
          gamma=gamma, slopes=slopes, knot_spacings=knot_spacings
      )
  
      assert distr.cdf(torch.Tensor([-2.0])).numpy().item() == 0.0
      assert distr.cdf(torch.Tensor([+2.0])).numpy().item() == 1.0
  
      expected_crps = np.array([1.0 + 2.0 / 3.0])
  
      assert np.allclose(
          distr.crps(torch.Tensor([-2.0])).numpy(), expected_crps
      )
  
      assert np.allclose(
          distr.crps(torch.Tensor([2.0])).numpy(), expected_crps
      )
  
file_path: gluonts/test/torch/distribution/test_torch_piecewise_linear.py
imports: from typing import Tuple, List
  import pytest
  import torch
  import numpy
  from gluonts.torch.distributions import PiecewiseLinear, PiecewiseLinearOutput
label_desc: Use image node_id 4 for calling a global function with example usage: test_simple_symmetric() without return types