import torch
from torchmetrics.retrieval import RetrievalMAP
metric = RetrievalMAP()
metric.update(torch.rand(10,), torch.randint(2, (10,)), indexes=torch.randint(2,(10,)))
fig_, ax_ = metric.plot()
