code: def test_hmm():
      C, V, batch, N = 5, 20, 2, 5
      transition = torch.rand(C, C)
      emission = torch.rand(V, C)
      init = torch.rand(C)
      observations = torch.randint(0, V, (batch, N))
      out = LinearChain.hmm(transition, emission, init, observations)
      LinearChain().sum(out)
  
imports: from torch_struct import CKY, CKY_CRF, DepTree, LinearChain, SemiMarkov, Alignment, deptree_nonproj, deptree_part
  from torch_struct import LogSemiring, CheckpointSemiring, CheckpointShardSemiring, KMaxSemiring, SparseMaxSemiring, MaxSemiring, StdSemiring, EntropySemiring
  from .extensions import LinearChainTest, SemiMarkovTest, DepTreeTest, CKYTest, CKY_CRFTest, test_lookup
  import torch
  from hypothesis import given
  from hypothesis.strategies import integers, data, sampled_from
  import pytest
  from hypothesis import settings
label_desc: Use image node_id 14 for calling a global function with example usage: test_hmm() without return types