code: def test_invalid_input():
      with pytest.raises(
          ValueError, match="Multiple unknown dimensions"
      ):
          features_lib.Tensor(
              shape=(2, None, None),
              dtype=np.uint8,
          ).encode_example(None)
  
      with pytest.raises(
          ValueError, match="Multiple unknown dimensions"
      ):
          features_lib.Tensor(
              shape=(2, None, None),
              dtype=tf.uint8,
          ).encode_example(None)
  
      with pytest.raises(
          NotImplementedError,
          match="does not support `encoding=` when dtype is string",
      ):
          features_lib.Tensor(
              shape=(2, 1),
              dtype=np.str_,
              encoding=features_lib.Encoding.BYTES,
          )
  
      with pytest.raises(
          NotImplementedError,
          match="does not support `encoding=` when dtype is string",
      ):
          features_lib.Tensor(
              shape=(2, 1),
              dtype=tf.string,
              encoding=features_lib.Encoding.BYTES,
          )
  
      with pytest.raises(
          TypeError,
          match="converting it to `bool` will always output `True`",
      ):
          features_lib.Tensor(
              shape=(),
              dtype=np.bool_,
              encoding=features_lib.Encoding.BYTES,
          ).encode_example("0")
  
      with pytest.raises(
          TypeError,
          match="converting it to `bool` will always output `True`",
      ):
          features_lib.Tensor(
              shape=(),
              dtype=np.bool_,
              encoding=features_lib.Encoding.BYTES,
          ).encode_example("False")
  
imports: from absl.testing import parameterized
  import jax.numpy
  import numpy
  import pytest
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import features
label_desc: Use image node_id 1 for calling a global function with example usage: test_invalid_input() without return types