class_docstr: Common methods for Conv/ConvTranspose tests.
code: def assertRaisesMaybeStaticError(self, msg):
      if tf.executing_eagerly() or self.use_static_shape:
          return self.assertRaisesRegex(ValueError, msg)
      return self.assertRaisesOpError(msg)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.nn.util import convolution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 1 for calling the _Common obj's underlying member method code with example usage: obj.assertRaisesMaybeStaticError(msg) and returns: self, self