Convert arc points to torch.float

This commit is contained in:
Oren Katzir
2023-01-09 09:25:35 +02:00
committed by Akko
parent 28e9dc0809
commit 0d69c2b05e

View File

@@ -164,7 +164,7 @@ def from_svg_path(path_str, shape_to_canvas = torch.eye(3), force_close = False)
assert(e.end.imag == points[0][1])
else:
points.append((e.end.real, e.end.imag))
points = torch.tensor(points)
points = torch.tensor(points, dtype=torch.float)
points = torch.cat((points, torch.ones([points.shape[0], 1])), dim = 1) @ torch.transpose(shape_to_canvas, 0, 1)
points = points / points[:, 2:3]
points = points[:, :2].contiguous()