import torch


def generate_coordinates(h, w):
    """
    Generate coordinates

    Args:
        h: height
        w: width

    Returns: [h*w, 2] FloatTensor
    """

    x = torch.floor((torch.arange(0, w * h) / w).float())
    y = torch.arange(0, w).repeat(h).float()

    coord = torch.stack([x, y], dim=1)
    return coord