def test_splice_signatures(self):
    sd1 = ShapeDtype((1,))
    sd2 = ShapeDtype((2,))
    sd3 = ShapeDtype((3,))
    sd4 = ShapeDtype((4,))
    sd5 = ShapeDtype((5,))

    # Signatures can be ShapeDtype instances, tuples of 2+ ShapeDtype instances,
    # or empty tuples.
    sig1 = sd1
    sig2 = (sd2, sd3, sd4)
    sig3 = ()
    sig4 = sd5
    spliced = shapes.splice_signatures(sig1, sig2, sig3, sig4)
    self.assertEqual(spliced, (sd1, sd2, sd3, sd4, sd5))