finetuner.device module#
- finetuner.device.get_device_pytorch(device)[source]#
Get Pytorch compute device. :type device:
str
:param device: device name.
- finetuner.device.to_device_pytorch(inputs, device)[source]#
Maps various input types to device. :type inputs:
Union
[~AnyTensor,Mapping
[str
, ~AnyTensor],Sequence
[~AnyTensor]] :param inputs: Inputs to be placed onto device. :param device: The torch device to be placed on. :rtype:Union
[~AnyTensor,Dict
[str
, ~AnyTensor],List
[~AnyTensor]] :return: The inputs on the specified device.
- finetuner.device.get_device_paddle(device)[source]#
Get Paddle compute device. :type device:
str
:param device: device name.
- finetuner.device.to_device_paddle(inputs, device)[source]#
Maps various input types to device. :type inputs:
Union
[~AnyTensor,Mapping
[str
, ~AnyTensor],Sequence
[~AnyTensor]] :param inputs: Inputs to be placed onto device. :param device: The paddle device to be placed on. :rtype:Union
[~AnyTensor,Dict
[str
, ~AnyTensor],List
[~AnyTensor]] :return: The inputs on the specified device.