Measurements of the yield and nuclear modification factor, $R_\mathrm{ AA}$, for inclusive jet production are performed using 0.49 nb$^{-1}$ of Pb+Pb data at $\sqrt{s_\mathrm{NN}} = 5.02$ TeV and 25 pb$^{-1}$ of $pp$ data at $\sqrt{s}=5.02$ TeV with the ATLAS detector at the LHC. Jets are reconstructed with the anti-$k_t$ algorithm with radius parameter $R=0.4$ and are measured over the transverse momentum range of 40-1000 GeV in six rapidity intervals covering $|y|<2.8$. The magnitude of $R_\mathrm{ AA}$ increases with increasing jet transverse momentum, reaching a value of approximately 0.6 at 1 TeV in the most central collisions. The magnitude of $R_\mathrm{ AA}$ also increases towards peripheral collisions. The value of $R_\mathrm{ AA}$ is independent of rapidity at low jet transverse momenta, but it is observed to decrease with increasing rapidity at high transverse momenta.