Skip to content

Conversation

@cnaples79
Copy link

Summary

Changes

  • Added sample_inputs_unique_consecutive function in extra_opinfo.py that filters samples from common_methods_invocations.sample_inputs_unique to only include cases with dim=None (as the implementation has limited dim support)
  • Added OpInfo entry for ops.aten.unique_consecutive with integral_types dtypes (matching the implementation which only supports int32/int64)
  • Added TorchLibOpInfo entry in ops_test_data.py to enable the test

Testing

The test follows the same pattern as other unique operator tests (_unique, _unique2, unique_dim) and reuses PyTorch's standard test infrastructure.

Fixes #2695

Added OpInfo-based test for torch.unique_consecutive operator:
- Created sample_inputs_unique_consecutive function in extra_opinfo.py
  that reuses common_methods_invocations.sample_inputs_unique
- Added OpInfo entry for ops.aten.unique_consecutive with integral_types
- Added TorchLibOpInfo entry in ops_test_data.py

Fixes microsoft#2695
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.09%. Comparing base (20a99d1) to head (853c43a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2742   +/-   ##
=======================================
  Coverage   70.09%   70.09%           
=======================================
  Files         226      226           
  Lines       27388    27388           
  Branches     2781     2781           
=======================================
  Hits        19198    19198           
  Misses       7234     7234           
  Partials      956      956           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[torchlib] Add op test to torch.unique_consecutive

1 participant