Daft icon indicating copy to clipboard operation
Daft copied to clipboard

Make casting image to tensor easier

Open jaychia opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

Today, when casting an image to tensor, the user is expected to know what the target type is: image

If the user gets the target type wrong (e.g. if the tensor is wrongly specified as having a float32 type), this results in a runtime panic.

Instead, we should provide a .image.to_tensor() function which will automatically determine the correct tensor type for the user. It should also automatically figure out if it is appropriate to produce a fixed shape tensor (for fixed size images) or a variable one (for variable images).

jaychia avatar Sep 27 '24 17:09 jaychia