Navigation
API > API/Plugins > API/Plugins/MLDeformerFrameworkEditor > API/Plugins/MLDeformerFrameworkEditor/FMLDeformerEditorModel
Description
This should update the list of available training devices. If not implemented, the user won't be able to pick a training device. With training device we mean the device used to store the tensors at. Typically you want to make it build a list of GPU's and have the CPU in there as well.
` UYourTrainingModel* TrainingModel = NewDerivedObject
You can implement the following in Python as an example: ` @unreal.ufunction(override=True) def update_available_devices(self): reload(mldeformer.training_helpers) mldeformer.training_helpers.update_training_device_list(self) _
Then inside the python code you can do something like:
` training_device = model.get_training_device() device_index = mldeformer.training_helpers.find_cuda_device_index(device_name=training_device) if torch.cuda.is_available() and device_index != -1: torch.cuda.set_device(device_index) _
| Name | UpdateTrainingDeviceList |
| Type | function |
| Header File | /Engine/Plugins/Animation/MLDeformer/MLDeformerFramework/Source/MLDeformerFrameworkEditor/Public/MLDeformerEditorModel.h |
| Include Path | #include "MLDeformerEditorModel.h" |
virtual void UpdateTrainingDeviceList()