Shortcuts

tensordict.nn.distributions.OneHotCategorical

class tensordict.nn.distributions.OneHotCategorical(logits: torch.Tensor | None = None, probs: torch.Tensor | None = None, **kwargs)

One-hot categorical distribution.

This class behaves excacly as torch.distributions.Categorical except that it reads and produces one-hot encodings of the discrete tensors.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources