model_maintainer#
Module Contents#
Maintain PyTorch model. |
- class ModelMaintainer(model, cuda)#
Bases:
object
Maintain PyTorch model.
Provide necessary attributes and operation methods. More features with local or global model will be implemented here.
- Parameters
model (torch.nn.Module) – PyTorch model.
cuda (bool) – use GPUs or not.
- property model(self)#
Return
torch.nn.module
- property model_parameters(self)#
Return serialized model parameters.
- property model_gradients(self)#
Return serialized model gradients.
- property shape_list(self)#
Return shape of model parameters.
Currently, this attributes used in tensor compression.