coremltools icon indicating copy to clipboard operation
coremltools copied to clipboard

Add clamp_min to PyTorch ops

Open pokidyshev opened this issue 2 years ago • 4 comments

This op is required to convert torch.nn.functional.normalize()

pokidyshev avatar Mar 31 '22 12:03 pokidyshev

Thank @pokidyshev for the PR. The op definition looks good.

In order to merge this PR, please add a unit test for clamp_min to test_torch_ops.py.

TobyRoseman avatar Mar 31 '22 23:03 TobyRoseman

@TobyRoseman not sure how to do that... Can you point out a good example? I'm currently looking at https://github.com/pokidyshev/coremltools/blob/7a4bf8bb6e0142565ef1c5ea6c56d75b959911c2/coremltools/converters/mil/frontend/torch/test/test_torch_ops.py#L2656

pokidyshev avatar Apr 12 '22 15:04 pokidyshev

@TobyRoseman not sure how to do that... Can you point out a good example?

Take a look at the unit test for torch.argsort.

TobyRoseman avatar Apr 12 '22 17:04 TobyRoseman

Great op! Thanks @pokidyshev

jakesabathia2 avatar Apr 13 '22 06:04 jakesabathia2

Closing this in favor or #1584

TobyRoseman avatar Aug 29 '22 23:08 TobyRoseman