Operating Modes#

Global Parameter Properties#

There are a variety of global settings in ivy, each of which comes with: ivy.<setting> (getter), ivy.set_<setting> (setter), and ivy.unset_<setting> (unsetter). Some of them are:

  1. array_significant_figures: Determines the number of significant figures to be shown when printing.

  2. array_decimal_values: Determines the number of decimal values to be shown when printing.

  3. warning_level: Determines the warning level to be shown when one occurs.

  4. nan_policy: Determines the policy of handling related to nan.

  5. dynamic_backend: Determines if the global dynamic backend setting is active or not.

  6. precise_mode: Determines whether to use a promotion table that avoids any precision loss or a compute efficient table that avoids most wider-than-necessary promotions.

  7. array_mode: Determines the mode of whether to convert inputs to ivy.NativeArray, then convert the outputs back to ivy.Array.

  8. nestable_mode: Determines the mode of whether to check if function inputs are ivy.Container.

  9. exception_trace_mode: Determines how much details of the ivy exception traces to be shown in the log.

  10. show_func_wrapper_trace_mode: Determines whether to show func_wrapper related traces in the log.

  11. min_denominator: Determines the global global minimum denominator used by ivy for numerically stable division.

  12. min_base: Determines the global global minimum base used by ivy for numerically stablestable power raising.

  13. queue_timeout: Determines the timeout value (in seconds) for the global queue.

  14. tmp_dir: Determines the name for the temporary folder if it is used.

  15. shape_array_mode: Determines whether to return shape as ivy.Array.

Let’s look into more details about getter and setter below!

Getter: ivy.<setting> attribute#

ivy.<setting> is a read-only static attribute. It acts as a getter and it will change internally whenever its related setter is used.

Should a user attempts to set the attribute directly, an error will be raised, suggesting them to change its value through the respective setter or unsetter.

Setter: ivy.set_<setting> and ivy.unset_<setting> functions#

In order to change the value of a property, setter functions must be used.

>>> ivy.array_mode
True
>>> ivy.set_array_mode(False)
>>> ivy.array_mode
False
>>> ivy.unset_array_mode()
>>> ivy.array_mode
True