import torch


def create_Ry_batch(a):
    """
    Creates a batch of rotation matrices about y of angles a.
    Input (batch)
    Output (batch, 3, 3)
    """
    return torch.stack([
        torch.stack([torch.cos(a),
                     torch.zeros_like(a),
                     -torch.sin(a)],
                    dim=1),
        torch.stack([torch.zeros_like(a),
                     torch.ones_like(a),
                     torch.zeros_like(a)],
                    dim=1),
        torch.stack([torch.sin(a),
                     torch.zeros_like(a),
                     torch.cos(a)],
                    dim=1)
    ], dim=2)