code: def test_register_array():
      reporter = Reporter()
      with reporter.observe("train", 1) as sub:
          with pytest.raises(ValueError):
              sub.register({"a": np.array([0, 1])})
              sub.next()
          with pytest.raises(ValueError):
              sub.register({"b": 1}, weight=np.array([1, 2]))
              sub.next()
  
imports: import logging
  import uuid
  from pathlib import Path
  import numpy
  import pytest
  import torch
  from torch.utils.tensorboard import SummaryWriter
  from espnet2.train.reporter import Average, ReportedValue, Reporter, aggregate
label_desc: Use image node_id 21 for calling a global function with example usage: test_register_array() without return types