フリー問題

PyTorch Certified Associate のフリー問題 9 / 20 問目

問題文

A developer defines a custom layer by subclassing nn.Module. Which pair of methods makes up the minimum they must provide for the layer to hold learnable state and be usable in a model?

選択肢

  1. Only a forward method, since state is registered automatically.
  2. A forward method and a backward method, because a subclass has to supply the derivative of its own computation.
  3. A forward method and a train method that switches modes.
  4. An initializer that calls the base class initializer and registers the state, and a forward method that performs the computation.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。