Daft
Daft copied to clipboard
Make casting image to tensor easier
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:
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).