Sadly, Windows Sandbox doesn't expose a proper GPU interface, even games barely run. You can create a Hyper-V VM and use a vGPU instead (still requires some PowerShell fiddling) but I'm not sure if the same interfaces needed by ML are supported by Hyper-V paravirtualization.
Sandbox and Hyper-V both create a sort-of RDP-based redirected GPU, but Sandbox is restricted to the “basic” mode exposed by the built-in RDP control.
Hyper-V has a similar one if you use the standard RDP console, but if you run a few cmdlets and use a different Remote Desktop app supporting graphics — e.g. Parsec — it can use a vGPU supporting real DirectX 10-12 (hardware API level, you can still use DX9 and such). But no NVIDIA/AMD/Intel drivers, so if you need PhysX, RTX and such, you’re screwed.