Documentation

Finding API Help

Every framework has thousands of functions and classes. You won’t memorize them — you’ll look them up.

Two Python builtins do most of the work:

  • dir(module) — what’s in here?
  • help(thing) (or ?thing in Jupyter) — how do I use it?

Plus the official docs: pytorch.org, jax.dev, tensorflow.org, mxnet.apache.org.

dir: discovering the API

Standard import:

from mxnet import np

dir(...) lists names in a module. Filter private names and show a small prefix on slides; in a notebook you can inspect the full list interactively:

print([name for name in dir(np.random) if not name.startswith('_')][:20])

help: usage details

Once you have the name, help(...) prints the docstring with arguments, defaults, and a usage example:

help(np.ones)

Then run a one-liner to confirm the call:

np.ones(4)

Recap

  • dir(module) — list contents.
  • help(symbol) (or symbol? in Jupyter) — show the docstring.
  • Notebook autocomplete (Tab) is your fastest discovery tool.
  • For prose-heavy explanations, deep links into the framework’s official documentation beat the inline help.