PyTorch 实现与追问

题集来源:Alireza Dirafzoon(alirezadir)收录项目:AIMLInterviews查看原题集

题目来源
Devinterview 其中第 85—146 题的题目索引来自 Devinterview,答案由 AIMLInterviews 重新撰写;原文的 50 题补充部分在此收录为 62 道,含拆分追问。

题目目录

156 道原题
  1. What are the essential steps in a PyTorch training loop?

    原题
  2. What is the difference between model.eval() and torch.no_grad() or torch.inference_mode()?

    原题
  3. What happens if you forget optimizer.zero_grad()?

    原题
  4. How would you refactor a monolithic ML script into clean modules?

    原题
  5. How would you write a utility that works on both CPU and GPU?

    原题
  6. What tests would you write for a tensor preprocessing or metric utility?

    原题
  7. What makes an ML utility reusable without excessive abstraction?

    原题
  8. Which validation belongs at module boundaries?

    原题
  9. When should a utility return tensors versus Python numbers?

    原题
  10. How do you keep preprocessing consistent across training, evaluation, and inference?

    原题