code: def test_position():
      """
      Test that nothing goes horribly wrong when position encodings are used
  
      Does not actually test the results of the encodings
      """
      ts = TransformerTreeStack(4, 5, 0.0, use_position=True)
      initial = ts.initial_state()
      assert len(initial) == 1
      assert initial.value.output.shape == torch.Size([5])
      assert initial.value.key_stack.shape == torch.Size([1, 5])
      assert initial.value.value_stack.shape == torch.Size([1, 5])
  
      rand_input = torch.randn(2, 4)
      one_step = ts.push_states([initial], ["A"], rand_input[0:1, :])[0]
      stacks = [one_step, initial]
      stacks = ts.push_states(stacks, ["B", "C"], rand_input)
  
file_path: stanza/stanza/tests/constituency/test_transformer_tree_stack.py
imports: import pytest
  import torch
  from stanza.models.constituency.transformer_tree_stack import TransformerTreeStack
label_desc: Use image node_id 7 for calling a global function with example usage: test_position() without return types