tensorshare.TensorShareServer
The Server module introduces all the routing, functions and dependencies for server side.
create_async_tensorshare_router(server_config=None, custom_operation=None)
Create and configure a new async TensorShare router using the given configuration and computation operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
server_config |
Optional[Dict[str, Union[str, Type[BaseModel]]]]
|
The server configuration to use for the router. |
None
|
custom_operation |
Optional[Callable[[TensorShare], Awaitable[Any]]]
|
The async custom computation operation to use for the |
None
|
Returns:
Name | Type | Description |
---|---|---|
APIRouter |
APIRouter
|
The configured TensorShare router ready to be integrated in a FastAPI app. |
Source code in src/tensorshare/server.py
create_tensorshare_router(server_config=None, custom_operation=None)
Create and configure a new TensorShare router using the given configuration and computation operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
server_config |
Optional[Dict[str, Union[str, Type[BaseModel]]]]
|
The server configuration to use for the router. |
None
|
custom_operation |
Optional[Callable]
|
The custom computation operation to use for the |
None
|
Returns:
Name | Type | Description |
---|---|---|
APIRouter |
APIRouter
|
The configured TensorShare router ready to be integrated in a FastAPI app. |
Source code in src/tensorshare/server.py
default_async_compute_operation(tensors)
async
Default asynchronous action to perform when receiving a TensorShare object.
default_compute_operation(tensors)
Created: 2023-08-20