The simplest way to add x is to pass it into the output as (y_pred, y, x).
Another way (more clearly implemented) is to reimplement iteration_completed() method : https://github.com/pytorch/ignite/blob/6faa6ac1e3a46c79e0dfcfd976439b86329717b0/ignite/metrics/metric.py#L198 3
and pass to update method everything it needs without “hiding” things: output, input, etc…
Let me know if it answers your question. Thanks