---
title: "pytorch-metric-learning 3.0.0 Breaking Changes on PyPI"
description: "What each pytorch-metric-learning release removed, renamed or changed: 597 breaking changes in 8 versions on PyPI, each with its source."
canonical_url: https://since.dev/packages/pypi/pytorch-metric-learning
last_updated: 2026-12-04
---

# pytorch-metric-learning breaking changes

pytorch-metric-learning 3.0.0 (October 31, 2026) is its newest release with breaking changes, 445 of them. The first: pytorch-metric-learning 3.0.0 drops support for Python 3.10 and 3.11 and requires Python 3.12 or later. Every breaking API change we have recorded in pytorch-metric-learning on PyPI: 597 breaking changes in 8 versions. Below, its 8 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `3.0.5`, released December 4, 2026. [Source repository](https://github.com/KevinMusgrave/pytorch-metric-learning)

Its 3.0.0 release requires [Python 3.12](https://since.dev/calendar/python/3.12.md) or later. [Python end of life dates](https://since.dev/calendar/python.md).

- From [2.0.0](#v-2-0-0) to [3.0.0](#v-3-0-0): 489 breaking changes in 6 versions.
- From [1.0.0](#v-1-0-0) to [3.0.0](#v-3-0-0): 547 breaking changes in 7 versions.

## pytorch-metric-learning 3.0.0 breaking changes

pytorch-metric-learning 3.0.0, released October 31, 2026: 445 breaking changes.

- **Removed**  

Version 3 requires Python 3.12 or newer, so older interpreters can no longer run the package. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed**  

The with-hooks extra and its record-keeper and TensorBoard integration were removed. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed** `AccuracyCalculator.get_curr_metrics`  

Read the metrics attribute instead, which is a tuple of the selected metric names. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed** `datasets.Cars196`  

Build the Cars196 dataset in application code and preserve the published split. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed** `datasets.CUB`  

Build the CUB-200-2011 dataset in application code and preserve the published split. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed** `InferenceModel`  

Write the equivalent inference code directly with PyTorch. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0)
- **Removed** `LpRegularizer`  

Passing distance to LpRegularizer now raises TypeError; remove the argument. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed** `P2SGradLoss`  

Passing distance to P2SGradLoss now raises TypeError, so remove the argument. [kevinmusgrave.github.io](https://kevinmusgrave.github.io/pytorch-metric-learning/migration-2-to-3/)
- **Removed** `pytorch_metric_learning.__version__`  

Read the installed version with importlib.metadata.version instead of \_\_version\_\_. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.datasets`  

The datasets package is gone; load data with your own PyTorch code. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.base_distance.ModuleWithRecords`  

pytorch_metric_learning.distances.base_distance.ModuleWithRecords was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BaseDistance.add_to_recordable_attributes`  

BaseDistance.add_to_recordable_attributes was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BaseDistance.collect_stats`  

BaseDistance.collect_stats was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BaseDistance.largest_dist`  

BaseDistance.largest_dist was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BaseDistance.reset_stats`  

BaseDistance.reset_stats was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BaseDistance.set_default_stats`  

BaseDistance.set_default_stats was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BaseDistance.smallest_dist`  

BaseDistance.smallest_dist was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BatchedDistance.__getattr__`  

BatchedDistance.\_\_getattr\_\_ was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.BatchedDistance.iter_fn`  

BatchedDistance.iter_fn was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.distances.lp_distance.lmu`  

pytorch_metric_learning.distances.lp_distance.lmu was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.angular_loss.c_f`  

pytorch_metric_learning.losses.angular_loss.c_f was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.angular_loss.lmu`  

pytorch_metric_learning.losses.angular_loss.lmu was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.AngularLoss.get_pairs`  

AngularLoss.get_pairs was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.AngularLoss.set_stats`  

Diagnostics must now be computed in caller code because the loss no longer records statistics. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.arcface_loss.c_f`  

pytorch_metric_learning.losses.arcface_loss.c_f was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.arcface_loss.LargeMarginSoftmaxLoss`  

pytorch_metric_learning.losses.arcface_loss.LargeMarginSoftmaxLoss was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.ArcFaceLoss.get_cos_with_margin`  

ArcFaceLoss.get_cos_with_margin was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.base_loss_wrapper`  

pytorch_metric_learning.losses.base_loss_wrapper was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.base_metric_loss_function.c_f`  

pytorch_metric_learning.losses.base_metric_loss_function.c_f was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.base_metric_loss_function.ModuleWithRecordsReducerAndDistance`  

pytorch_metric_learning.losses.base_metric_loss_function.ModuleWithRecordsReducerAndDistance was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseLossWrapper`  

pytorch_metric_learning.losses.BaseLossWrapper was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.add_embedding_regularization_to_loss_dict`  

BaseMetricLossFunction.add_embedding_regularization_to_loss_dict was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.add_to_recordable_attributes`  

BaseMetricLossFunction.add_to_recordable_attributes was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.all_regularization_loss_names`  

BaseMetricLossFunction.all_regularization_loss_names was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.collect_stats`  

BaseMetricLossFunction.collect_stats was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.embedding_regularization_loss`  

BaseMetricLossFunction.embedding_regularization_loss was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.get_default_distance`  

BaseMetricLossFunction.get_default_distance was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.get_default_reducer`  

BaseMetricLossFunction.get_default_reducer was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.regularization_loss_names`  

BaseMetricLossFunction.regularization_loss_names was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.reset_stats`  

BaseMetricLossFunction.reset_stats was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.set_reducer`  

BaseMetricLossFunction.set_reducer was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.sub_loss_names`  

BaseMetricLossFunction.sub_loss_names was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.zero_loss`  

BaseMetricLossFunction.zero_loss was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.BaseMetricLossFunction.zero_losses`  

BaseMetricLossFunction.zero_losses was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.circle_loss.c_f`  

pytorch_metric_learning.losses.circle_loss.c_f was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.circle_loss.lmu`  

pytorch_metric_learning.losses.circle_loss.lmu was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.CircleLoss.delta_n`  

CircleLoss.delta_n was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.CircleLoss.delta_p`  

CircleLoss.delta_p was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.CircleLoss.m`  

CircleLoss.m was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.losses.CircleLoss.on`  

CircleLoss.on was removed in pytorch-metric-learning 3.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)

And 395 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## pytorch-metric-learning 3.0.0rc5 breaking changes

pytorch-metric-learning 3.0.0rc5, released October 31, 2026: 4 breaking changes.

- **Removed** `losses.CentroidTripletLoss.swap`  

The rewritten CentroidTripletLoss no longer accepts swap; remove it from calls. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc5)
- **Removed** `losses.CentroidTripletLoss.triplets_per_anchor`  

The rewritten CentroidTripletLoss no longer accepts triplets_per_anchor; remove it from calls. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc5)
- **Behavior changed** `ManifoldLoss`  

ManifoldLoss now raises TypeError when given a distance that is not a similarity; use a similarity distance. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc5)
- **Default changed** `losses.CentroidTripletLoss`  

The default distance changed to the paper's squared Euclidean distance, so results differ from earlier versions unless you pass a distance explicitly. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc5)

## pytorch-metric-learning 3.0.0rc4 breaking changes

pytorch-metric-learning 3.0.0rc4, released October 31, 2026: 1 breaking change.

- **Behavior changed** `RetrievalInputs`  

Code that constructs RetrievalInputs directly must supply reference_labels and ref_includes_query. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc4)

## pytorch-metric-learning 3.0.0rc3 breaking changes

pytorch-metric-learning 3.0.0rc3, released October 31, 2026: 2 breaking changes.

- **Default changed** `DotProductSimilarity`  

DotProductSimilarity now computes a plain dot product; pass normalize_embeddings=True for the previous behavior. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc3)
- **Default changed** `TripletMarginLoss`  

The default margin is now 0.2; pass margin=0.05 for the previous default. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc3)

## pytorch-metric-learning 3.0.0rc2 breaking changes

pytorch-metric-learning 3.0.0rc2, released October 31, 2026: 3 breaking changes.

- **Behavior changed** `CrossBatchMemory4MultiLabel`  

Use CrossBatchMemory with label_shape and pair_function instead. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc2)
- **Default changed** `TupletMarginLoss`  

Endpoint angles now have zero angular gradient at nonzero margin. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc2)
- **Signature changed** `pytorch_metric_learning.losses.LargeMarginSoftmaxLoss.modify_cosine_of_target_classes`  

Subclasses of ArcFaceLoss, CosFaceLoss and LargeMarginSoftmaxLoss now get labels as a second argument. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)

## pytorch-metric-learning 3.0.0rc1 breaking changes

pytorch-metric-learning 3.0.0rc1, released October 31, 2026: 34 breaking changes.

- **Removed** `AccuracyCalculator.metric_functions`  

metric_functions, requires_knn, requires_clustering, aggregate and the calculate\_\* methods are removed. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)
- **Removed** `collect_stats`  

Compute diagnostics from returned tensors or forward hooks instead. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)
- **Removed** `InferenceModel`  

Training and evaluation orchestration is removed; use the equivalent PyTorch code shown in the recipes. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)
- **Removed** `pytorch_metric_learning.miners.HDCMiner.set_idx_externally`  

Pass candidate tuples through the indices_tuple argument of forward instead. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.python`  

The package requires Python 3.12 or newer. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)
- **Removed** `pytorch_metric_learning.utils.accuracy_calculator`  

Retrieval metrics and backends now live in pytorch_metric_learning.evaluation. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `pytorch_metric_learning.utils.loss_and_miner_utils`  

Use utils.indexing instead; everything else under utils is private. [pypi.org](https://pypi.org/project/pytorch-metric-learning/3.0.0/)
- **Removed** `sub_loss_names`  

Custom losses no longer use these attributes. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)
- **Renamed** `AngularMiner`  

Pass alpha=... instead of angle. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)
- **Renamed** `CircleLoss`  

Pass margin=... instead of m. [github.com](https://github.com/KevinMusgrave/pytorch-metric-learning/releases/tag/v3.0.0rc1)

And 24 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Older versions

2 older versions, each with its first changes. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

### pytorch-metric-learning 2.0.0 breaking changes

pytorch-metric-learning 2.0.0, released January 29, 2023: 58 breaking changes.

- **Removed** `pytorch_metric_learning.distances.BaseDistance.set_stats`  

BaseDistance.set_stats was removed in pytorch-metric-learning 2.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/2.0.0/)
- **Removed** `pytorch_metric_learning.losses.centroid_triplet_loss`  

pytorch_metric_learning.losses.centroid_triplet_loss was removed in pytorch-metric-learning 2.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/2.0.0/)

And 56 more in this version.

### pytorch-metric-learning 1.0.0 breaking changes

pytorch-metric-learning 1.0.0, released November 28, 2021: 50 breaking changes.

- **Removed** `pytorch_metric_learning.losses.CrossBatchMemory.embedding_memory`  

CrossBatchMemory.embedding_memory was removed in pytorch-metric-learning 1.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/1.0.0/)
- **Removed** `pytorch_metric_learning.losses.CrossBatchMemory.has_been_filled`  

CrossBatchMemory.has_been_filled was removed in pytorch-metric-learning 1.0.0 [pypi.org](https://pypi.org/project/pytorch-metric-learning/1.0.0/)

And 48 more in this version.

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
