pyflink.multimodal.expression.ImageExpressionAccessor.to_tensor#
- ImageExpressionAccessor.to_tensor(*, width: int, height: int, mode: str = 'RGB', layout: Literal['CHW', 'HWC'] = 'CHW', concurrency: Optional[int] = None) pyflink.table.expression.Expression[source]#
Convert already prepared image values to fixed-shape tensors.
Equivalent to
image_to_tensor(). See that function for full parameter details. This operation does not resize or convert image mode. Use.image.resize(...)or.image.convert_mode(...)upstream when needed.- Parameters
width – Expected input image width in pixels.
height – Expected input image height in pixels.
mode – Expected input image mode before tensor conversion.
layout – Tensor layout, such as
"CHW"or"HWC".concurrency – Optional execution concurrency for this operation.
Noneuses the framework default.
- Returns
A DataFrame expression that produces a
FLOAT32tensor with the requested shape and layout.