oneflow.utils.global_view.current_global_mode¶
-
class
oneflow.utils.global_view.
current_global_mode
¶ Get the current global mode information.
Use the current_global_mode to get the information of global mode, including enabled, placement and sbp.
Note: the sbp property is supposed to return a list/tuple of oneflow.sbp.sbp.
Example:
.. code-block:: python with global_mode(True, placement=P, sbp=B): # Get the global mode info. cur_global_mode = global_view.current_global_mode() test_case.assertTrue(cur_global_mode.is_enabled) test_case.assertEqual(cur_global_mode.placement, P) test_case.assertEqual(cur_global_mode.sbp[0], B)
-
__init__
(self: oneflow._oneflow_internal.global_view.current_global_mode) → None¶
Methods
__delattr__
(name, /)Implement delattr(self, name).
__dir__
()Default dir() implementation.
__eq__
(value, /)Return self==value.
__format__
(format_spec, /)Default object formatter.
__ge__
(value, /)Return self>=value.
__getattribute__
(name, /)Return getattr(self, name).
__gt__
(value, /)Return self>value.
__hash__
()Return hash(self).
__init__
(self)__init_subclass__
This method is called when a class is subclassed.
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
__new__
(**kwargs)Create and return a new object.
__reduce__
()Helper for pickle.
__reduce_ex__
(protocol, /)Helper for pickle.
__repr__
()Return repr(self).
__setattr__
(name, value, /)Implement setattr(self, name, value).
__sizeof__
()Size of object in memory, in bytes.
__str__
()Return str(self).
__subclasshook__
Abstract classes can override this to customize issubclass().
Attributes
is_enabled
placement
sbp
-