code: def test_sample(n_cutpoints, pred_shape):
      predictor = torch.randn(pred_shape)
      cutpoints = torch.sort(torch.randn(n_cutpoints)).values
      dist = OrderedLogistic(predictor, cutpoints, validate_args=True)
      sample = dist.sample([100])
      assert sample.shape[1:] == pred_shape
      assert sample.min().item() >= 0
      assert sample.max().item() <= n_cutpoints
  
file_path: pyro/tests/distributions/test_ordered_logistic.py
imports: import pytest
  import torch
  from torch.autograd.functional import jacobian
  from pyro.distributions import Normal, OrderedLogistic
  from pyro.distributions.transforms import OrderedTransform
label_desc: Use image node_id 1 for calling a global function with example usage: test_sample(n_cutpoints, pred_shape) without return types