MCPcopy Index your code
hub / github.com/apple/ml-pointersect / to

Method to

pointersect/inference/structures.py:1034–1039  ·  view source on GitHub ↗
(self, device: torch.device)

Source from the content-addressed store, hash-verified

1032 self.directions_w = directions_w
1033
1034 def to(self, device: torch.device) -> 'Ray':
1035 for attr_name in ['origins_w', 'directions_w']:
1036 arr = getattr(self, attr_name, None)
1037 if arr is not None:
1038 setattr(self, attr_name, arr.to(device=device))
1039 return self
1040
1041 def reshape(self, *shape: T.List[int]):
1042 self.origins_w = self.origins_w.reshape(*shape)

Callers 15

_stepMethod · 0.45
_testMethod · 0.45
_testMethod · 0.45
_testMethod · 0.45
testMethod · 0.45
to_tensorFunction · 0.45
to_deviceFunction · 0.45
to_dtypeFunction · 0.45
generate_camera_raysFunction · 0.45

Calls

no outgoing calls

Tested by 5

_stepMethod · 0.36
_testMethod · 0.36
_testMethod · 0.36
_testMethod · 0.36
testMethod · 0.36