Navigation
API > API/Plugins > API/Plugins/NeuralMorphModelEditor > API/Plugins/NeuralMorphModelEditor/FNeuralMorphEditorModel
- FMLDeformerEditorModel::UpdateTrainingDeviceList()
- FNeuralMorphEditorModel::UpdateTrainingDeviceList()
References
| Module | NeuralMorphModelEditor |
| Header | /Engine/Plugins/Animation/MLDeformer/NeuralMorphModel/Source/NeuralMorphModelEditor/Public/NeuralMorphEditorModel.h |
| Include | #include "NeuralMorphEditorModel.h" |
| Source | /Engine/Plugins/Animation/MLDeformer/NeuralMorphModel/Source/NeuralMorphModelEditor/Private/NeuralMorphEditorModel.cpp |
virtual void UpdateTrainingDeviceList()
Remarks
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) _