code: def test_simple_symmetric():
      gamma = mx.nd.array([-1.0])
      slopes = mx.nd.array([[2.0, 2.0]])
      knot_spacings = mx.nd.array([[0.5, 0.5]])
  
      distr = PiecewiseLinear(
          gamma=gamma, slopes=slopes, knot_spacings=knot_spacings
      )
  
      assert distr.cdf(mx.nd.array([-2.0])).asnumpy().item() == 0.0
      assert distr.cdf(mx.nd.array([+2.0])).asnumpy().item() == 1.0
  
      expected_crps = np.array([1.0 + 2.0 / 3.0])
  
      assert np.allclose(
          distr.crps(mx.nd.array([-2.0])).asnumpy(), expected_crps
      )
  
      assert np.allclose(
          distr.crps(mx.nd.array([2.0])).asnumpy(), expected_crps
      )
  
file_path: gluonts/test/mx/distribution/test_piecewise_linear.py
imports: from typing import List, Tuple
  import mxnet
  import numpy
  import pytest
  from gluonts.core.serde import dump_json, load_json
  from gluonts.mx.distribution import FixedKnotsPiecewiseLinearOutput, PiecewiseLinear, PiecewiseLinearOutput
  from gluonts.testutil import empirical_cdf
label_desc: Use image node_id 3 for calling a global function with example usage: test_simple_symmetric() without return types