imaginaire.model_utils.gancraft.voxlib package

Submodules

imaginaire.model_utils.gancraft.voxlib.positional_encoding module

class imaginaire.model_utils.gancraft.voxlib.positional_encoding.PositionalEncodingFunction[source]

Bases: torch.autograd.function.Function

static backward(ctx, out_feature_grad)[source]

Defines a formula for differentiating the operation.

This function is to be overridden by all subclasses.

It must accept a context ctx as the first argument, followed by as many outputs did forward() return, and it should return as many tensors, as there were inputs to forward(). Each argument is the gradient w.r.t the given output, and each returned value should be the gradient w.r.t. the corresponding input.

The context can be used to retrieve tensors saved during the forward pass. It also has an attribute ctx.needs_input_grad as a tuple of booleans representing whether each input needs gradient. E.g., backward() will have ctx.needs_input_grad[0] = True if the first input to forward() needs gradient computated w.r.t. the output.

static forward(ctx, in_feature, pe_degrees, dim, incl_orig)[source]

Performs the operation.

This function is to be overridden by all subclasses.

It must accept a context ctx as the first argument, followed by any number of arguments (tensors or other types).

The context can be used to store tensors that can be then retrieved during the backward pass.

imaginaire.model_utils.gancraft.voxlib.positional_encoding.positional_encoding(in_feature, pe_degrees, dim=-1, incl_orig=False)[source]
imaginaire.model_utils.gancraft.voxlib.positional_encoding.positional_encoding_pt(pts, pe_degrees, dim=-1, incl_orig=False)[source]

imaginaire.model_utils.gancraft.voxlib.setup module

imaginaire.model_utils.gancraft.voxlib.sp_trilinear module

class imaginaire.model_utils.gancraft.voxlib.sp_trilinear.SparseTrilinearWorldCoordFunction[source]

Bases: torch.autograd.function.Function

static backward(ctx, out_feature_grad)[source]

Defines a formula for differentiating the operation.

This function is to be overridden by all subclasses.

It must accept a context ctx as the first argument, followed by as many outputs did forward() return, and it should return as many tensors, as there were inputs to forward(). Each argument is the gradient w.r.t the given output, and each returned value should be the gradient w.r.t. the corresponding input.

The context can be used to retrieve tensors saved during the forward pass. It also has an attribute ctx.needs_input_grad as a tuple of booleans representing whether each input needs gradient. E.g., backward() will have ctx.needs_input_grad[0] = True if the first input to forward() needs gradient computated w.r.t. the output.

static forward(ctx, in_feature, corner_lut_t, in_worldcoord, ign_zero)[source]

Performs the operation.

This function is to be overridden by all subclasses.

It must accept a context ctx as the first argument, followed by any number of arguments (tensors or other types).

The context can be used to store tensors that can be then retrieved during the backward pass.

imaginaire.model_utils.gancraft.voxlib.sp_trilinear.sparse_trilinear_interp_worldcoord(in_feature, corner_lut_t, in_worldcoord, ign_zero=False)[source]

imaginaire.model_utils.gancraft.voxlib.voxlib module

imaginaire.model_utils.gancraft.voxlib.voxlib.positional_encoding(arg0: at::Tensor, arg1: int, arg2: int, arg3: bool) → at::Tensor

Fused Positional Encoding [forward] (CUDA)

imaginaire.model_utils.gancraft.voxlib.voxlib.positional_encoding_backward(arg0: at::Tensor, arg1: at::Tensor, arg2: int, arg3: int, arg4: bool) → at::Tensor

Fused Positional Encoding [backward] (CUDA)

imaginaire.model_utils.gancraft.voxlib.voxlib.ray_voxel_intersection_perspective(arg0: at::Tensor, arg1: at::Tensor, arg2: at::Tensor, arg3: at::Tensor, arg4: float, arg5: List[float], arg6: List[int], arg7: int) → List[at::Tensor]

Ray-voxel intersections given perspective camera parameters (CUDA)

imaginaire.model_utils.gancraft.voxlib.voxlib.sp_trilinear_worldcoord(arg0: at::Tensor, arg1: at::Tensor, arg2: at::Tensor, arg3: bool, arg4: int) → at::Tensor

Sparse Trilinear interpolation, world coordinate [forward] (CUDA)

imaginaire.model_utils.gancraft.voxlib.voxlib.sp_trilinear_worldcoord_backward(arg0: at::Tensor, arg1: at::Tensor, arg2: at::Tensor, arg3: at::Tensor, arg4: bool, arg5: bool) → List[at::Tensor]

Sparse Trilinear interpolation, world coordinate [backward] (CUDA)

Module contents