def get(self,keys: Union[str, List[str]],tensors: Union[torch.Tensor, List[torch.Tensor], List[List[torch.Tensor]]],**kwargs) -> List[bool]

Function

Reads the tensor data of one key or a group of keys. Generally, the tensor data can be filled in the given tensors (as the output buffer) in place.

Prototype

def get(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]]

  • str: reads a single entry.
  • List[str]: indicates batch read. The sequence is the same as the return or filling sequence.

tensors

Union[Tensor, List[Tensor], List[List[Tensor]]]

  • Tensor: A single key corresponds to a single tensor.
  • List[Tensor]: Multiple keys correspond to a list of tensors with the same length.
  • List[List[Tensor]]: A two-dimensional list is used for multi-shard or multi-segment writing.

**kwargs

-

  • allow_missing (bool): Whether to allow missing items and return placeholders or skip. The default value is False.
  • verify_shape (bool): Whether to enforce shape and dtype validation. The default value is True.
  • shard (Any): indicates the shard policy or identifier.
  • Other implementation-related parameters (such as pin_memory and non-blocking).

Return Value

List[bool]: indicates the current keys fetched from the pooling backend and the boolean values indicating success/failure for the corresponding tensors filled in place. 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.