code: def test_incorrect_type(average):
      # Tests changing of type during training
  
      pr = Precision(average=average)
      assert pr._updated is False
  
      y_pred = torch.softmax(torch.rand(4, 4), dim=1)
      y = torch.ones(4).long()
      pr.update((y_pred, y))
      assert pr._updated is True
  
      y_pred = torch.randint(0, 2, size=(4,))
      y = torch.ones(4).long()
  
      with pytest.raises(RuntimeError):
          pr.update((y_pred, y))
  
      assert pr._updated is True
  
imports: import warnings
  import pytest
  import torch
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.metrics import precision_score
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics import Precision
label_desc: Use image node_id 11 for calling a global function with example usage: test_incorrect_type(average) without return types