Environment
Module: opytimizer.core.environment
Wrapper API class for backend control logic
Constructor
Environment(device: "Literal['numpy', 'cupy']" = 'numpy', dtype: 'str' = 'float32')
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
device | Literal['numpy', 'cupy'] | 'numpy' | — |
dtype | str | 'float32' | — |
Methods
reset
reset(self) -> 'Environment'
Resets to the standard values
set_backend
set_backend(self, backend: "Literal['numpy', 'cupy'] | Backend") -> 'Environment'
Defines computational backend
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
backend | `Literal['numpy', 'cupy'] | Backend` |
set_dtype
set_dtype(self, dtype: 'str') -> 'Environment'
Defines arrays data type
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
dtype | str | — |