class_docstr: Tests for state vectors containing nan values or shot vectors with zero shots.
class_docstr_tok: ["Tests","for","state","vectors","containing","nan","values","or","shot","vectors","with","zero","shots","."]
docstr: Test that the result of circuits with 0 probability postselections is NaN with the
  expected shape.
docstr_tok: ["Test","that","the","result","of","circuits","with","0","probability","postselections","is","NaN","with","the","expected","shape","."]
code: def test_nan_samples(self, mp, interface, shots):
      """Test that the result of circuits with 0 probability postselections is NaN with the
      expected shape."""
      state = qml.math.full((2, 2), np.NaN, like=interface)
      res = measure_with_samples(
          (mp,), state, _FlexShots(shots), is_state_batched=False
      )
  
      if not isinstance(shots, list):
          assert isinstance(res, tuple)
          res = res[0]
          assert (
              qml.math.shape(res) == (shots,)
              if len(mp.wires) == 1
              else (shots, len(mp.wires))
          )
  
      else:
          assert isinstance(res, tuple)
          assert len(res) == 2
          for i, r in enumerate(res):
              assert isinstance(r, tuple)
              r = r[0]
              assert (
                  qml.math.shape(r) == (shots[i],)
                  if len(mp.wires) == 1
                  else (shots[i], len(mp.wires))
              )
  
imports: from random import shuffle
  import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.simulate import _FlexShots
  from pennylane.devices.qubit import sample_state, measure_with_samples
  from pennylane.devices.qubit.sampling import _sample_state_jax
  from pennylane.measurements import Shots
label_desc: Use image node_id 3 for calling the TestInvalidStateSamples obj's underlying member method code with example usage: obj.test_nan_samples(mp, interface, shots) without return types