class_docstr: Tests that broadcasted operations are applied correctly.
class_docstr_tok: ["Tests","that","broadcasted","operations","are","applied","correctly","."]
docstr: Tests that the batch_size is set on an operator if it was missing before.
  Mostly useful for TF-autograph since it may have batch size set to None.
docstr_tok: ["Tests","that","the","batch_size","is","set","on","an","operator","if","it","was","missing","before",".","Mostly","useful","for","TF-autograph","since","it","may","have","batch","size","set","to","None","."]
code: def test_batch_size_set_if_missing(self, method, ml_framework):
      """Tests that the batch_size is set on an operator if it was missing before.
      Mostly useful for TF-autograph since it may have batch size set to None.
      """
      param = qml.math.asarray([0.1, 0.2, 0.3], like=ml_framework)
      state = np.ones((2, 2)) / 2
      op = qml.RX(param, 0)
      assert (
          op._batch_size is _UNSET_BATCH_SIZE
      )  # pylint:disable=protected-access
      state = method(op, state)
      assert state.shape == (3, 2, 2)
      assert op.batch_size == 3
  
imports: from functools import reduce
  import pytest
  import numpy
  from scipy.stats import unitary_group
  import pennylane
  from pennylane.operation import _UNSET_BATCH_SIZE, Operation
  from pennylane.devices.qubit.apply_operation import apply_operation, apply_operation_einsum, apply_operation_tensordot
label_desc: Use image node_id 4 for calling the TestBroadcasting obj's underlying member method code with example usage: obj.test_batch_size_set_if_missing(method, ml_framework) without return types