def testTensordotErrors(self):
    a = onp.random.random((3, 2, 2))
    b = onp.random.random((2,))
    self.assertRaisesRegex(TypeError, 'Number of tensordot axes.*exceeds input ranks.*', (lambda : jnp.tensordot(a, b, axes=2)))
    self.assertRaisesRegex(TypeError, 'tensordot requires axes lists to have equal length.*', (lambda : jnp.tensordot(a, b, axes=([0], [0, 1]))))
    self.assertRaisesRegex(TypeError, 'tensordot requires both axes lists to be either ints, tuples or lists.*', (lambda : jnp.tensordot(a, b, axes=('bad', 'axes'))))
    self.assertRaisesRegex(TypeError, 'tensordot axes argument must be an int, a pair of ints, or a pair of lists.*', (lambda : jnp.tensordot(a, b, axes='badaxes')))
def testTensordotErrors(self):
    a = onp.random.random((3, 2, 2))
    b = onp.random.random((2,))
    self.assertRaisesRegex(TypeError, 'Number of tensordot axes.*exceeds input ranks.*', (lambda : jnp.tensordot(a, b, axes=2)))
    self.assertRaisesRegex(TypeError, 'tensordot requires axes lists to have equal length.*', (lambda : jnp.tensordot(a, b, axes=([0], [0, 1]))))
    self.assertRaisesRegex(TypeError, 'tensordot requires both axes lists to be either ints, tuples or lists.*', (lambda : jnp.tensordot(a, b, axes=('bad', 'axes'))))
    self.assertRaisesRegex(TypeError, 'tensordot axes argument must be an int, a pair of ints, or a pair of lists.*', (lambda : jnp.tensordot(a, b, axes='badaxes')))