import torch


def create_xyz_tensor(sl):
    """
    Return an 32 x 32 x 32 x 3 tensor where each len 3 inner tensor is
    the xyz coordinates of that position
    """
    incr_t = torch.arange(sl, dtype=torch.float64)
    z = incr_t.expand(sl, sl, sl).unsqueeze(3)
    y = incr_t.unsqueeze(1).expand(sl, sl, sl).unsqueeze(3)
    x = incr_t.unsqueeze(1).unsqueeze(2).expand(sl, sl, sl).unsqueeze(3)
    xyz = torch.cat([x, y, z], 3)
    return xyz