Python function
defaults
defaults()โ
max.experimental.tensor.defaults(dtype=None, device=None)
Gets the default dtype and device for tensor creation.
Returns a tuple containing the dtype and device to use for tensor creation,
applying defaults when values are not specified. If no dtype is provided,
defaults to DType.float32 for CPU and DType.bfloat16 for
accelerators. If no device is provided, defaults to an accelerator if
available, otherwise CPU.
-
Parameters:
-
Returns:
-
A tuple containing the resolved dtype and device.
-
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!