class_docstr: Related to minibatch training
class_docstr_tok: ["Related","to","minibatch","training"]
code: def test_common_errors(self):
      with pytest.raises(ValueError, match="Length of"):
          with pm.Model() as m:
              pm.Normal(
                  "n", observed=[[1]], total_size=[2, Ellipsis, 2, 2]
              )
              m.logp()
      with pytest.raises(ValueError, match="Length of"):
          with pm.Model() as m:
              pm.Normal("n", observed=[[1]], total_size=[2, 2, 2])
              m.logp()
      with pytest.raises(
          TypeError, match="Invalid type for total_size"
      ):
          with pm.Model() as m:
              pm.Normal("n", observed=[[1]], total_size="foo")
              m.logp()
      with pytest.raises(NotImplementedError, match="Cannot convert"):
          with pm.Model() as m:
              pm.Normal("n", observed=[[1]], total_size=["foo"])
              m.logp()
      with pytest.raises(ValueError, match="Only one Ellipsis"):
          with pm.Model() as m:
              pm.Normal(
                  "n", observed=[[1]], total_size=[Ellipsis, Ellipsis]
              )
              m.logp()
  
      with pm.Model() as model4:
          with pytest.raises(
              ValueError, match="only be passed to observed RVs"
          ):
              pm.Normal("n", shape=(1, 1), total_size=[2, 2])
  
file_path: pymc/tests/variational/test_minibatch_rv.py
imports: import numpy
  import pytensor
  import pytest
  from scipy import stats
  import pymc
  from pymc import Normal, draw
  from pymc.data import minibatch_index
  from pymc.testing import select_by_precision
  from pymc.variational.minibatch_rv import create_minibatch_rv
  from tests.test_data import gen1, gen2
label_desc: Use image node_id 5 for calling the TestMinibatchRandomVariable obj's underlying member method code with example usage: obj.test_common_errors() without return types