Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input / Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
    • Multimodal Expressions
  • PyFlink Multimodal
  • PyFlink Table
  • PyFlink DataStream
  • PyFlink Common

pyflink.dataframe.DataType.tensor#

classmethod DataType.tensor(dtype: Union[str, pyflink.table.types.ElementDType], shape: tuple = ()) → pyflink.dataframe.datatype.DataType[source]#

Tensor type.

Uses the first-class TENSOR logical type so that shape metadata is carried natively by Flink’s type system rather than via a sideband metadata mechanism.

Parameters
  • dtype – Tensor element dtype. Supported string values are: "bool", "int8", "uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64", "float32", and "float64". The corresponding ElementDType enum values are also supported.

  • shape – Optional fixed shape tuple, e.g. (3, 224, 224). An empty shape means variable-shape tensor.

Example:

>>> DataType.tensor("float32", shape=(3, 224, 224))
>>> DataType.tensor("uint8", shape=(224, 224, 3))
>>> DataType.tensor("float32")

previous

pyflink.dataframe.DataType.row

next

pyflink.dataframe.DataType.image

Show Source

Created using Sphinx 4.5.0.