Configuration

class softs.BatchConfig[source]

BatchConfig(specs: list[softs.configs.TensorSpec])

specs: list[TensorSpec]
property tensor_names: list[str]
nbytes()[source]
Return type:

int

get_spec(name)[source]
Parameters:

name (str)

Return type:

TensorSpec

get_offset(name)[source]
Parameters:

name (str)

Return type:

int

encode(**tensors)[source]
Parameters:

tensors (Tensor)

Return type:

bytes

decode(data)[source]
Parameters:

data (bytes)

Return type:

dict[str, Tensor]

decode_single(data, name)[source]
Parameters:
Return type:

Tensor

classmethod from_dict(config)[source]
Parameters:

config (dict)

Return type:

BatchConfig

classmethod from_yaml(path)[source]
Parameters:

path (str)

Return type:

BatchConfig

to_dict()[source]
Return type:

dict

__init__(specs)
Parameters:

specs (list[TensorSpec])

Return type:

None

class softs.TensorSpec[source]

TensorSpec(name: str, shape: tuple[int, …], dtype: str)

name: str
shape: tuple[int, ...]
dtype: str
property torch_dtype: dtype
property numel: int
property nbytes: int
encode(tensor)[source]
Parameters:

tensor (Tensor)

Return type:

bytes

decode(data)[source]
Parameters:

data (bytes)

Return type:

Tensor

__init__(name, shape, dtype)
Parameters:
Return type:

None

class softs.EndpointConfig[source]

EndpointConfig(frontend: str = ‘ipc:///tmp/softs_frontend.sock’, backend: str = ‘ipc:///tmp/softs_backend.sock’)

frontend: str = 'ipc:///tmp/softs_frontend.sock'
backend: str = 'ipc:///tmp/softs_backend.sock'
classmethod from_yaml(path)[source]
Parameters:

path (str)

Return type:

EndpointConfig

__init__(frontend='ipc:///tmp/softs_frontend.sock', backend='ipc:///tmp/softs_backend.sock')
Parameters:
  • frontend (str)

  • backend (str)

Return type:

None

softs.make_xy_config(x_shape, x_dtype, y_shape, y_dtype)[source]
Parameters:
Return type:

BatchConfig