If I understand your case correctly, the following would work
import torch
import torch.nn as nn

from ignite.engine import Engine, create_supervised_evaluator, Events
from ignite.metrics import Loss

data = [
    # inputs, targets, weight_map
    [torch.rand(1), torch.rand(1), torch.rand(2)],
    [torch.rand(1), torch.rand(1), torch.rand(2)],
    [torch.rand(1), torch.rand(1), torch.rand(2)],
    [torch.rand(1), torch.rand(1), torch.rand(2)]
]

net = nn.Linear(1, 1)
optimizer = torch.optim.SGD(net.parameters(), lr=0.001)

class WMapLoss(nn.Module):
    
    def forward(self, y_pred, y, weight_map):
        return (y_pred - y).sum() + weight_map.sum()


criterion = WMapLoss()


def update_model(engine, batch):
    inputs, targets, weight_map = batch
    optimizer.zero_grad()
    outputs = net(inputs)
    loss = criterion(outputs, targets, weight_map)
    loss.backward()
    optimizer.step()
    return loss.item()


def eval_fn(engine, batch):
    net.eval()
    with torch.no_grad():
        inputs, targets, weight_map = batch
        outputs = net(inputs)
        return outputs, targets, {"weight_map": weight_map}


trainer = Engine(update_model)
evaluator = Engine(eval_fn)

metrics={"val loss": Loss(criterion)}

for name, metric in metrics.items():
    metric.attach(evaluator, name)


@trainer.on(Events.EPOCH_COMPLETED)
def run_validation():
    evaluator.run(data)

trainer.run(data, max_epochs=2)
print(evaluator.state.metrics)
> {'val loss': 1.027790516614914}

Tell me if this works or does not work for you.