How does one obtain gradients as data efficiently?

seems I need to read this: Clone and detach in v0.4.0