def test_rezero_forward_shape(self):
    """Tests that the forward pass runs and returns the expected shape."""
    vocab_size = 16
    model = rezero.ReZeroTransformer(
        vocab_size, d_model=32, d_ff=64, n_encoder_layers=2, n_decoder_layers=2,
        n_heads=2, max_len=16)
    xs = [np.ones((1, 8)).astype(np.int32),
          np.ones((1, 8)).astype(np.int32)]
    _, _ = model.init(shapes.signature(xs))
    ys = model(xs)
    self.assertEqual([y.shape for y in ys], [(1, 8, 16), (1, 8)])
Tests that the forward pass runs and returns the expected shape.
trax/models/research/rezero_test.py