code: def test_view_reshape_bug():
      batch_shape = (1, 2, 1, 3, 1)
      sample_shape = (4,)
      cardinality = 2
      logits = torch.randn(batch_shape + (cardinality,))
      dist.Categorical(logits=logits).sample(sample_shape)
  
imports: from unittest import TestCase
  import numpy
  import pytest
  import scipy.stats
  import torch
  import pyro.distributions
  from tests.common import assert_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_view_reshape_bug() without return types