You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The grid is stored in a sparse format using `NanoVDB <https://github.com/AcademySoftwareFoundation/openvdb/tree/feature/nanovdb>`_
99
+
where only active (non-empty) voxels are allocated, making it extremely memory efficient for representing large volumes with sparse
100
+
occupancy.
77
101
78
102
.. note::
79
103
@@ -239,7 +263,7 @@ def from_ijk(
239
263
ijk (torch.Tensor): Voxel coordinates to populate. A :class:`torch.Tensor` with shape ``(num_voxels, 3)`` with integer coordinates.
240
264
voxel_size (NumericMaxRank1): Size of each voxel, broadcastable to shape ``(3,)``, floating dtype
241
265
origin (NumericMaxRank1): Origin of the grid. *i.e.* the world-space position of the center of the ``[0,0,0]`` voxel, broadcastable to shape ``(3,)``, floating dtype
242
-
device (DeviceIdentifier | None): Device to create the grid on. Defaults to None, which inherits from ``ijk``.
266
+
device (DeviceIdentifier | None): Device to create the grid on. Defaults to None, which inherits the device of ``ijk``.
243
267
244
268
Returns:
245
269
grid (Grid): A new :class:`Grid` object.
@@ -274,7 +298,7 @@ def from_mesh(
274
298
mesh_faces (torch.Tensor): Faces of the mesh. A :class:`torch.Tensor` with shape ``(num_faces, 3)``.
275
299
voxel_size (NumericMaxRank1): Size of each voxel, broadcastable to shape ``(3,)``, floating dtype
276
300
origin (NumericMaxRank1): Origin of the grid. *i.e.* the world-space position of the center of the ``[0,0,0]`` voxel, broadcastable to shape ``(3,)``, floating dtype
277
-
device (DeviceIdentifier | None): Device to create the grid on. Defaults to ``None``, which inherits from ``mesh_vertices``.
301
+
device (DeviceIdentifier | None): Device to create the grid on. Defaults to ``None``, which inherits the device of ``mesh_vertices``.
278
302
279
303
Returns:
280
304
grid (Grid): A new :class:`Grid` object with voxels covering the surface of the input mesh.
Halo convolution only supports convolving when the input and output grids are the same.
1693
+
Halo convolution only supports convolving when the input and output grid topology match, thus
1694
+
this method does not accept an output grid. *i.e.* the output features will be associated with
1695
+
this :class:`Grid`.
1670
1696
1671
1697
Args:
1672
1698
input (torch.Tensor): Input features for each voxel in this :class:`Grid`.
@@ -1753,7 +1779,7 @@ def refine(
1753
1779
1754
1780
.. note::
1755
1781
1756
-
If you pass ``fine_grid = None``, this method will create a new fine grid with its
1782
+
If you pass ``fine_grid = None``, this method will create a new fine :class:`Grid` with its
1757
1783
voxel size divided by the ``subdiv_factor`` and its origin adjusted accordingly.
1758
1784
1759
1785
.. note::
@@ -1773,7 +1799,7 @@ def refine(
1773
1799
subdiv_factor (NumericMaxRank1): Refinement factor between this :class:`Grid` and the fine grid, broadcastable to shape ``(3,)``, integer dtype
1774
1800
data (torch.Tensor): Voxel data to refine. A :class:`torch.Tensor` of shape ``(total_voxels, channels)``.
1775
1801
mask (torch.Tensor, optional): Boolean mask of shape ``(self.num_voxels,)``indicating which voxels in the input :class:`Grid` to refine. If ``None``, data associated with all input voxels are refined.
1776
-
fine_grid (Grid, optional): Pre-allocated fine grid to use for output. If ``None``, a new grid is created.
1802
+
fine_grid (Grid, optional): Pre-allocated fine :class:`Grid` to use for output. If ``None``, a new :class:`Grid` is created.
1777
1803
1778
1804
Returns:
1779
1805
tuple[torch.Tensor, Grid]: A tuple containing:
@@ -1797,7 +1823,7 @@ def refined_grid(
1797
1823
mask: torch.Tensor|None=None,
1798
1824
) ->"Grid":
1799
1825
"""
1800
-
Return a refined version of the grid. *i.e* each voxel in this :class:`Grid` is subdivided
1826
+
Return a refined version of this :class:`Grid`. *i.e* each voxel in this :class:`Grid` is subdivided
1801
1827
by the specified ``subdiv_factor`` to create a higher-resolution grid.
1802
1828
1803
1829
.. note::
@@ -1815,7 +1841,7 @@ def refined_grid(
1815
1841
mask (torch.Tensor, optional): Boolean mask indicating which voxels to refine. If ``None``, all voxels are refined.
1816
1842
1817
1843
Returns:
1818
-
Grid: A new Grid with refined structure.
1844
+
grid (Grid): A new :class:`Grid` with refined structure.
Move grid batch to a target device or to match the device of an object (*e.g.* another :class:`Grid`, a :class:`JaggedTensor`, a :class:`torch.Tensor`, etc.).
1892
+
Move this :class:`Grid` to a target device or to match the device of an object (*e.g.* another :class:`Grid`, a :class:`JaggedTensor`, a :class:`torch.Tensor`, etc.).
1867
1893
1868
1894
Args:
1869
1895
target (str | torch.device | torch.Tensor | JaggedTensor | Grid): Target object to determine the device.
0 commit comments