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
)
| 43 | return mesh_laplacian(src_meshes, def_meshes) |
| 44 | |
| 45 | def _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 | |
| 61 | def _handle_pointcloud_input( |
| 62 | points: Union[torch.Tensor, Pointclouds], |