Optional ======== Constructs an optional-type value containing either an empty optional of a certain type specified by the attribute, or a non-empty value containing the input element. **Abstract Signature:** ``Optional(input, type)`` .. raw:: html

PyTorch

API: torch.nn.functional.Optional
Strategy: Direct Mapping

Apple MLX

API: mlx.optimizers.Optional
Strategy: Direct Mapping