Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions fvdb/convolution_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,16 @@ def from_grid_batch(
kernel_size = to_Vec3i(kernel_size, value_constraint=ValueConstraint.POSITIVE)
stride = to_Vec3i(stride, value_constraint=ValueConstraint.POSITIVE)

if not _vec_is_all(kernel_size, kernel_size[0].item()):
raise NotImplementedError("Non-uniform kernel sizes are not currently supported")
if not _vec_is_all(stride, 1):
raise NotImplementedError("Strides not equal to 1 are not currently supported")

if not _vec_is_all(stride, stride[0].item()):
raise NotImplementedError("Non-uniform strides are not currently supported")

backend = expert_config.get("backend", "default")
if backend != "default":
raise NotImplementedError("Non-default backends are not currently supported")

if backend in ["dense", "halo", "lggs"]:
if target_grid is not None:
raise ValueError("Target grid must be None for dense, halo, and lggs backends.")
Expand Down Expand Up @@ -267,12 +271,16 @@ def from_grid_batch_transposed(
kernel_size = to_Vec3i(kernel_size, value_constraint=ValueConstraint.POSITIVE)
stride = to_Vec3i(stride, value_constraint=ValueConstraint.POSITIVE)

if not _vec_is_all(kernel_size, kernel_size[0].item()):
raise NotImplementedError("Non-uniform kernel sizes are not currently supported")
if not _vec_is_all(stride, 1):
raise NotImplementedError("Strides not equal to 1 are not currently supported")

if not _vec_is_all(stride, stride[0].item()):
raise NotImplementedError("Non-uniform strides are not currently supported")

backend = expert_config.get("backend", "default")
if backend != "default":
raise NotImplementedError("Non-default backends are not currently supported")

if backend == "dense":
if target_grid is not None:
raise ValueError("Target grid must be None for dense backend, transposed.")
Expand Down Expand Up @@ -348,12 +356,16 @@ def from_grid(
kernel_size = to_Vec3i(kernel_size, value_constraint=ValueConstraint.POSITIVE)
stride = to_Vec3i(stride, value_constraint=ValueConstraint.POSITIVE)

if not _vec_is_all(kernel_size, kernel_size[0].item()):
raise NotImplementedError("Non-uniform kernel sizes are not currently supported")
if not _vec_is_all(stride, 1):
raise NotImplementedError("Strides not equal to 1 are not currently supported")

if not _vec_is_all(stride, stride[0].item()):
raise NotImplementedError("Non-uniform strides are not currently supported")

backend = expert_config.get("backend", "default")
if backend != "default":
raise NotImplementedError("Non-default backends are not currently supported")

if backend in ["dense", "halo", "lggs"]:
if target_grid is not None:
raise ValueError("Target grid must be None for dense, halo, and lggs backends.")
Expand Down Expand Up @@ -424,12 +436,16 @@ def from_grid_transposed(
kernel_size = to_Vec3i(kernel_size, value_constraint=ValueConstraint.POSITIVE)
stride = to_Vec3i(stride, value_constraint=ValueConstraint.POSITIVE)

if not _vec_is_all(kernel_size, kernel_size[0].item()):
raise NotImplementedError("Non-uniform kernel sizes are not currently supported")
if not _vec_is_all(stride, 1):
raise NotImplementedError("Strides not equal to 1 are not currently supported")

if not _vec_is_all(stride, stride[0].item()):
raise NotImplementedError("Non-uniform strides are not currently supported")

backend = expert_config.get("backend", "default")
if backend != "default":
raise NotImplementedError("Non-default backends are not currently supported")

if backend == "dense":
if target_grid is not None:
raise ValueError("Target grid must be None for dense backend, transposed.")
Expand Down
Loading
Loading