code: def test_mvnormal_shape_size_difference(self):
      # Parameters add one batch dimension (4), shape is what you'd expect.
      # Under the hood the shape(4, 3) becomes size=(4,) and the RV is initially
      # created as (4, 4, 3). The internal ndim-check then recreates it with size=None.
      rv = pm.MvNormal.dist(
          mu=np.ones((4, 3)), cov=np.eye(3), shape=(4, 3)
      )
      assert rv.ndim == 2
      assert tuple(rv.shape.eval()) == (4, 3)
  
      # shape adds two dimensions (5, 4)
      # Under the hood the shape=(5, 4, 3) becomes size=(5, 4).
      # The RV is created as (5, 4, 3) right away.
      rv = pm.MvNormal.dist(
          mu=[1, 2, 3], cov=np.eye(3), shape=(5, 4, 3)
      )
      assert rv.ndim == 3
      assert tuple(rv.shape.eval()) == (5, 4, 3)
  
      # parameters add 1 batch dimension (4), shape adds another (5)
      # Under the hood the shape=(5, 4, 3) becomes size=(5, 4)
      # The RV is initially created as (5, 4, 3, 4, 3) and then recreated and resized.
      rv = pm.MvNormal.dist(
          mu=np.ones((4, 3)), cov=np.eye(3), shape=(5, 4, 3)
      )
      assert rv.ndim == 3
      assert tuple(rv.shape.eval()) == (5, 4, 3)
  
      rv = pm.MvNormal.dist(mu=[1, 2, 3], cov=np.eye(3), size=(5, 4))
      assert tuple(rv.shape.eval()) == (5, 4, 3)
  
      rv = pm.MvNormal.dist(
          mu=np.ones((5, 4, 3)), cov=np.eye(3), size=(5, 4)
      )
      assert tuple(rv.shape.eval()) == (5, 4, 3)
  
imports: import re
  import warnings
  import numpy
  import pytensor
  import pytest
  from pytensor import tensor
  from pytensor.compile.mode import Mode
  from pytensor.graph import Constant, ancestors
  from pytensor.tensor import TensorVariable
  from pytensor.tensor.random import normal
  from pytensor.tensor.shape import SpecifyShape
  import pymc
  from pymc import ShapeError
  from pymc.distributions.shape_utils import broadcast_dist_samples_shape, change_dist_size, convert_dims, convert_shape, convert_size, get_support_shape, get_support_shape_1d, rv_size_is_none, to_tuple
  from pymc.model import Model
label_desc: Use image node_id 12 for calling the TestSizeShapeDimsObserved obj's underlying member method code with example usage: obj.test_mvnormal_shape_size_difference() without return types