dmlc / dlpack

common in-memory tensor structure
https://dmlc.github.io/dlpack/latest
Apache License 2.0
911 stars 133 forks source link

[Feature Request] protobuf dlpack support #112

Open edgarriba opened 2 years ago

edgarriba commented 2 years ago

hey guys what do you think about giving support to protobuf ? I have a current need to share/log tensor data via python.

Wanted to discuss here before starting myself. I image something like this soon in kornia

from dlpack import dlpack_pb2
import kornia as K

img: K.core.Image = K.io.read_image(...)

# img.to_proto() will convert tensor data (numpy/torch) to `dlpack_pb2`
K.io.save(..., img.to_proto())

img_proto: dlpack_pb2.DLTensor = K.io.load(....)
img_load: K.core.Image = Image.from_proto(img_proto)