florist.api.servers.common module

Common functions and definitions for servers.

class Model(value)[source]

Bases: Enum

Enumeration of supported models.

MNIST = 'MNIST'
classmethod class_for_model(model)[source]

Return the class for a given model.

Parameters:

model (Model) – (Model) The model enumeration object.

Return type:

type[Module]

Returns:

(type[torch.nn.Module]) A torch.nn.Module class corresponding to the given model.

Raises:

ValueError – if the client is not supported.

classmethod list()[source]

List all the supported models.

Return type:

List[str]

Returns:

(List[str]) a list of supported models.