import tensorflow as tfEvery 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 APIStandard import:
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:
['Algorithm', 'Generator', 'all_candidate_sampler', 'categorical', 'create_rng_state', 'experimental', 'fixed_unigram_candidate_sampler', 'fold_in', ...
help: usage detailsOnce you have the name, help(...) prints the docstring with arguments, defaults, and a usage example:
Help on function ones in module tensorflow.python.ops.array_ops:
ones(shape, dtype=tf.float32, name=None, layout=None)
Creates a tensor with all elements set to one (1).
See also `tf.ones_like`, `tf.zeros`, `tf.fill`, `tf.eye`.
...
layout: Optional, `tf.experimental.dtensor.Layout`. If provided, the result
is a [DTensor](https://www.tensorflow.org/guide/dtensor_overview) with the
provided layout.
Returns:
A `Tensor` with all elements set to one (1).
dir(module) — list contents.help(symbol) (or symbol? in Jupyter) — show the docstring.Tab) is your fastest discovery tool.