MCPcopy Create free account
hub / github.com/AiuniAI/Unique3D / _warmup

Function _warmup

scripts/project_mesh.py:59–66  ·  view source on GitHub ↗
(glctx, device=None)

Source from the content-addressed store, hash-verified

57import nvdiffrast.torch as dr
58
59def _warmup(glctx, device=None):
60 device = 'cuda' if device is None else device
61 #windows workaround for https://github.com/NVlabs/nvdiffrast/issues/59
62 def tensor(*args, **kwargs):
63 return torch.tensor(*args, device=device, **kwargs)
64 pos = tensor([[[-0.8, -0.8, 0, 1], [0.8, -0.8, 0, 1], [-0.8, 0.8, 0, 1]]], dtype=torch.float32)
65 tri = tensor([[0, 1, 2]], dtype=torch.int32)
66 dr.rasterize(glctx, pos, tri, resolution=[256, 256])
67
68class Pix2FacesRenderer:
69 def __init__(self, device="cuda"):

Callers 1

__init__Method · 0.70

Calls 1

tensorFunction · 0.70

Tested by

no test coverage detected