set_device function¶
(Shortest import: from brian2 import set_device)
-
brian2.devices.device.set_device(device, build_on_run=True, **kwargs)[source]¶ Set the device used for simulations.
- Parameters
device :
Deviceor strThe
Deviceobject or the name of the device.build_on_run : bool, optional
Whether a call to
run()(orNetwork.run) should directly trigger aDevice.build. This is only relevant for standalone devices and means that a run call directly triggers the start of a simulation. If the simulation consists of multiple run calls, setbuild_on_runtoFalseand callDevice.buildexplicitly. Defaults toTrue.kwargs : dict, optional
Only relevant when
build_on_runisTrue: additional arguments that will be given to theDevice.buildcall.