MCPcopy Create free account
hub / github.com/Colin97/DeepMetaHandles / _validate_chamfer_reduction_inputs

Function _validate_chamfer_reduction_inputs

src/losses.py:45–59  ·  view source on GitHub ↗

Check the requested reductions are valid. Args: batch_reduction: Reduction operation to apply for the loss across the batch, can be one of ["mean", "sum"] or None. point_reduction: Reduction operation to apply for the loss across the points, can be one of

(
    batch_reduction: Union[str, None], point_reduction: str
)

Source from the content-addressed store, hash-verified

43 return mesh_laplacian(src_meshes, def_meshes)
44
45def _validate_chamfer_reduction_inputs(
46 batch_reduction: Union[str, None], point_reduction: str
47):
48 """Check the requested reductions are valid.
49
50 Args:
51 batch_reduction: Reduction operation to apply for the loss across the
52 batch, can be one of ["mean", "sum"] or None.
53 point_reduction: Reduction operation to apply for the loss across the
54 points, can be one of ["mean", "sum"].
55 """
56 if batch_reduction is not None and batch_reduction not in ["mean", "sum"]:
57 raise ValueError('batch_reduction must be one of ["mean", "sum"] or None')
58 if point_reduction not in ["mean", "sum"]:
59 raise ValueError('point_reduction must be one of ["mean", "sum"]')
60
61def _handle_pointcloud_input(
62 points: Union[torch.Tensor, Pointclouds],

Callers 1

chamfer_distanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected