Skip to main content

encoder

superduper.ext.torch.encoder

Source code

tensor​

tensor(dtype,
shape: Sequence,
bytes_encoding: Optional[str] = None,
encodable: str = 'encodable',
db: Optional[ForwardRef('Datalayer')] = None)
ParameterDescription
dtypeThe dtype of the tensor.
shapeThe shape of the tensor.
bytes_encodingThe bytes encoding to use.
encodableThe encodable name ["artifact", "encodable", "lazy_artifact", "file"].
dbThe datalayer instance.

Create an encoder for a tensor of a given dtype and shape.

DecodeTensor​

DecodeTensor(self,
dtype,
shape)
ParameterDescription
dtypeThe dtype of the tensor, eg. torch.float32
shapeThe shape of the tensor, eg. (3, 4)

Decode a tensor from bytes.

EncodeTensor​

EncodeTensor(self,
dtype)
ParameterDescription
dtypeThe dtype of the tensor, eg. torch.float32

Encode a tensor to bytes.