  We consider a one-parameter family of composite fields -- bi-linear in the
components of the stress-energy tensor -- which generalise the
$\mathrm{T}\bar{\mathrm{T}}$ operator to arbitrary space-time dimension $d\geq
2$. We show that they induce a deformation of the classical action which is
equivalent -- at the level of the dynamics -- to a field-dependent modification
of the background metric tensor according to a specific flow equation. Even
though the starting point is the flat space, the deformed metric is generally
curved for any $d>2$, thus implying that the corresponding deformation can not
be interpreted as a coordinate transformation. The central part of the paper is
devoted to the development of a recursive algorithm to compute the coefficients
of the power series expansion of the solution to the metric flow equation. We
show that, under some quite restrictive assumptions on the stress-energy
tensor, the power series yields an exact solution. Finally, we consider a class
of theories in $d=4$ whose stress-energy tensor fulfils the assumptions above
mentioned, namely the family of abelian gauge theories in $d=4$. For such
theories, we obtain the exact expression of the deformed metric and the
vierbein. In particular, the latter result implies that ModMax theory in a
specific curved space is dynamically equivalent to its Born-Infeld-like
extension in flat space. We also discuss a dimensional reduction of the latter
theories from $d=4$ to $d=2$ in which an interesting marginal deformation of
$d=2$ field theories emerges.
