def put(self,keys: Union[str, List[str]],tensors: Union[torch.Tensor, List[torch.Tensor], List[List[torch.Tensor]]],**kwargs) -> List[bool]
Function
Writes or overwrites the tensor data corresponding to one key or a group of keys.
Prototype
def put(self,keys: Union[str, List[str]],tensors: Union[torch.Tensor, List[torch.Tensor], List[List[torch.Tensor]]],**kwargs ) -> List[bool]:
Parameters
Parameter |
Type |
Description |
|---|---|---|
keys |
Union[str, List[str]] |
|
tensors |
Union[Tensor, List[Tensor], List[List[Tensor]]] |
|
**kwargs |
- |
|
Return Value
- List[bool]: indicates the current keys written to the pooling backend and the boolean values indicating success or failure for the corresponding tensors. Each boolean value corresponds to the result of each key. If keys is of the str type, the return value is still of List[bool] type and the length is 1.
Parent topic: class MemPool