MCPcopy Create free account
hub / github.com/openai/shap-e / __init__

Method __init__

shap_e/models/volume.py:94–118  ·  view source on GitHub ↗

:param bbox_min: the left/bottommost corner of the bounding box :param bbox_max: the other corner of the bounding box :param min_dist: all rays should start at least this distance away from the origin.

(
        self,
        *,
        bbox_min: ArrayType,
        bbox_max: ArrayType,
        min_dist: float = 0.0,
        min_t_range: float = 1e-3,
        device: torch.device = torch.device("cuda"),
    )

Source from the content-addressed store, hash-verified

92 """
93
94 def __init__(
95 self,
96 *,
97 bbox_min: ArrayType,
98 bbox_max: ArrayType,
99 min_dist: float = 0.0,
100 min_t_range: float = 1e-3,
101 device: torch.device = torch.device("cuda"),
102 ):
103 """
104 :param bbox_min: the left/bottommost corner of the bounding box
105 :param bbox_max: the other corner of the bounding box
106 :param min_dist: all rays should start at least this distance away from the origin.
107 """
108 super().__init__()
109
110 self.bbox_min = to_torch(bbox_min).to(device)
111 self.bbox_max = to_torch(bbox_max).to(device)
112 self.min_dist = min_dist
113 self.min_t_range = min_t_range
114 self.bbox = torch.stack([self.bbox_min, self.bbox_max])
115 assert self.bbox.shape == (2, 3)
116 assert self.min_dist >= 0.0
117 assert self.min_t_range > 0.0
118 self.device = device
119
120 def intersect(
121 self,

Callers

nothing calls this directly

Calls 3

to_torchFunction · 0.90
toMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected