♻️ In-place Operations Visualizer

Normal addition spawns a brand new memory block every time. x.add_(y) overwrites the same block in place.

πŸ“‹ How To Use This Lab
  1. Flip the switch to choose z = x + y (out-of-place) or x.add_(y) (in-place).
  2. Press Next Step β–Ά β€” watch a new block spawn, or the old block fade and overwrite itself.
  3. Watch the RAM meter β€” only out-of-place operations make it climb.
  4. Keep going with out-of-place until memory fills up β€” then switch to in-place to keep computing for free.
Mira x = [1, 2, 3, 4] y (constant) RAM Pool Live Memory Meter
πŸ€– MIRAPick out-of-place or in-place, then press Next Step β€” watch what happens to memory either way.
πŸ§‘β€πŸ« PROF. TORCHAny PyTorch method ending in an underscore, like add_(), mul_(), or relu_(), modifies the tensor in place.

πŸŽ›οΈ Choose an Operation

Operation Mode
z = x + y
x.add_(y)