Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • DataType
  • pyflink.dataframe.datatype.DataType.tensor

pyflink.dataframe.datatype.DataType.tensor#

classmethod DataType.tensor(dtype: DataType, shape: tuple) → DataType[source]#

Fixed-shape 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 – Element type, e.g. DataType.float32() or DataType.int8().

  • shape – Shape tuple, e.g. (3, 224, 224). Must be fully specified (no dynamic dimensions).

Example:

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

previous

pyflink.dataframe.datatype.DataType.struct

next

User Defined Functions

On this page
  • DataType.tensor()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.