I have a suggestion. tensor.new() looks unobvious in the code. Maybe torch could mimic numpy and provide torch.empty_like(tensor), torch.ones_like(tensor) and torch.zeros_like(tensor) instead? Or maybe new() does something more sophisticated?