GstTensor

Hold tensor data

Members

id (GQuark) –

semantically identify the contents of the tensor

layout (GstTensorLayout) –

Indicate tensor layout

data_type (GstTensorDataType) –

GstTensorDataType of tensor data

data (GstBuffer *) –

GstBuffer holding tensor data

dims_order (GstTensorDimOrder) –

Indicate tensor elements layout in memory.

num_dims (gsize) –

number of tensor dimensions

dims (gsize *) –

number of tensor dimensions

Since : 1.26


GstAnalytics.Tensor

Hold tensor data

Members

id (GLib.Quark) –

semantically identify the contents of the tensor

Indicate tensor layout

data (Gst.Buffer) –

Gst.Buffer holding tensor data

dims_order (GstAnalytics.TensorDimOrder) –

Indicate tensor elements layout in memory.

num_dims (Number) –

number of tensor dimensions

dims ([ Number ]) –

number of tensor dimensions

Since : 1.26


GstAnalytics.Tensor

Hold tensor data

Members

id (GLib.Quark) –

semantically identify the contents of the tensor

Indicate tensor layout

data (Gst.Buffer) –

Gst.Buffer holding tensor data

dims_order (GstAnalytics.TensorDimOrder) –

Indicate tensor elements layout in memory.

num_dims (int) –

number of tensor dimensions

dims ([ int ]) –

number of tensor dimensions

Since : 1.26


Constructors

gst_tensor_alloc

GstTensor *
gst_tensor_alloc (gsize num_dims)

Allocate a tensor with num_dims dimensions.

Parameters:

num_dims

Number of dimension of the tensors

Returns ( [transfer: full][not nullable])

tensor allocated

Since : 1.26


GstAnalytics.Tensor.prototype.alloc

function GstAnalytics.Tensor.prototype.alloc(num_dims: Number): {
    // javascript wrapper for 'gst_tensor_alloc'
}

Allocate a tensor with num_dims dimensions.

Parameters:

num_dims (Number)

Number of dimension of the tensors

Returns (GstAnalytics.Tensor)

tensor allocated

Since : 1.26


GstAnalytics.Tensor.alloc

def GstAnalytics.Tensor.alloc (num_dims):
    #python wrapper for 'gst_tensor_alloc'

Allocate a tensor with num_dims dimensions.

Parameters:

num_dims (int)

Number of dimension of the tensors

Returns (GstAnalytics.Tensor)

tensor allocated

Since : 1.26


gst_tensor_new_simple

GstTensor *
gst_tensor_new_simple (GQuark id,
                       GstTensorDataType data_type,
                       GstBuffer * data,
                       GstTensorDimOrder dims_order,
                       gsize num_dims,
                       gsize * dims)

Allocates a new GstTensor of dims_order ROW_MAJOR or COLUMN_MAJOR and with an interleaved layout.

For example, a two-dimensional tensor with 32 rows and 4 columns, dims would be the two element array [32, 4].

Parameters:

id

semantically identify the contents of the tensor

data_type

GstTensorDataType of tensor data

data ( [transfer: full])

GstBuffer holding tensor data

dims_order

Indicate tensor dimension indexing order

num_dims

number of tensor dimensions

dims ( [arraylength=num_dims])

size of tensor in each dimension. A value of 0 means the dimension is dynamic.

Returns

A newly allocated GstTensor

Since : 1.26


GstAnalytics.Tensor.prototype.new_simple

function GstAnalytics.Tensor.prototype.new_simple(id: GLib.Quark, data_type: GstAnalytics.TensorDataType, data: Gst.Buffer, dims_order: GstAnalytics.TensorDimOrder, num_dims: Number, dims: [ Number ]): {
    // javascript wrapper for 'gst_tensor_new_simple'
}

Allocates a new GstAnalytics.Tensor of dims_order ROW_MAJOR or COLUMN_MAJOR and with an interleaved layout.

For example, a two-dimensional tensor with 32 rows and 4 columns, dims would be the two element array [32, 4].

Parameters:

id (GLib.Quark)

semantically identify the contents of the tensor

data (Gst.Buffer)

Gst.Buffer holding tensor data

dims_order (GstAnalytics.TensorDimOrder)

Indicate tensor dimension indexing order

num_dims (Number)

number of tensor dimensions

dims ([ Number ])

size of tensor in each dimension. A value of 0 means the dimension is dynamic.

Returns (GstAnalytics.Tensor)

A newly allocated GstAnalytics.Tensor

Since : 1.26


GstAnalytics.Tensor.new_simple

def GstAnalytics.Tensor.new_simple (id, data_type, data, dims_order, num_dims, dims):
    #python wrapper for 'gst_tensor_new_simple'

Allocates a new GstAnalytics.Tensor of dims_order ROW_MAJOR or COLUMN_MAJOR and with an interleaved layout.

For example, a two-dimensional tensor with 32 rows and 4 columns, dims would be the two element array [32, 4].

Parameters:

id (GLib.Quark)

semantically identify the contents of the tensor

data (Gst.Buffer)

Gst.Buffer holding tensor data

dims_order (GstAnalytics.TensorDimOrder)

Indicate tensor dimension indexing order

num_dims (int)

number of tensor dimensions

dims ([ int ])

size of tensor in each dimension. A value of 0 means the dimension is dynamic.

Returns (GstAnalytics.Tensor)

A newly allocated GstAnalytics.Tensor

Since : 1.26


Methods

gst_tensor_check_type

gboolean
gst_tensor_check_type (const GstTensor * tensor,
                       GstTensorDataType data_type,
                       GstTensorDimOrder order,
                       gsize num_dims,
                       const gsize * dims)

Validate the tensor whether it mathces the reading order, dimensions and the data type. Validate whether the GstBuffer has enough size to hold the tensor data.

Parameters:

tensor

A GstTensor

data_type

The data type of the tensor

order

The order of the tensor to read from the memory

num_dims

The number of dimensions that the tensor can have

dims ( [arraylength=num_dims][nullable])

An optional array of dimensions, where G_MAXSIZE means ANY.

Returns

TRUE if the GstTensor has the reading order from the memory matching order, dimensions matching num_dims, data type matching data_type Otherwise FALSE will be returned.

Since : 1.28


GstAnalytics.Tensor.prototype.check_type

function GstAnalytics.Tensor.prototype.check_type(data_type: GstAnalytics.TensorDataType, order: GstAnalytics.TensorDimOrder, num_dims: Number, dims: [ Number ]): {
    // javascript wrapper for 'gst_tensor_check_type'
}

Validate the tensor whether it mathces the reading order, dimensions and the data type. Validate whether the Gst.Buffer has enough size to hold the tensor data.

Parameters:

data_type (GstAnalytics.TensorDataType)

The data type of the tensor

The order of the tensor to read from the memory

num_dims (Number)

The number of dimensions that the tensor can have

dims ([ Number ])

An optional array of dimensions, where G_MAXSIZE means ANY.

Returns (Number)

TRUE if the GstAnalytics.Tensor has the reading order from the memory matching order, dimensions matching num_dims, data type matching data_type Otherwise FALSE will be returned.

Since : 1.28


GstAnalytics.Tensor.check_type

def GstAnalytics.Tensor.check_type (self, data_type, order, num_dims, dims):
    #python wrapper for 'gst_tensor_check_type'

Validate the tensor whether it mathces the reading order, dimensions and the data type. Validate whether the Gst.Buffer has enough size to hold the tensor data.

Parameters:

data_type (GstAnalytics.TensorDataType)

The data type of the tensor

The order of the tensor to read from the memory

num_dims (int)

The number of dimensions that the tensor can have

dims ([ int ])

An optional array of dimensions, where G_MAXSIZE means ANY.

Returns (bool)

TRUE if the GstAnalytics.Tensor has the reading order from the memory matching order, dimensions matching num_dims, data type matching data_type Otherwise FALSE will be returned.

Since : 1.28


gst_tensor_copy

GstTensor *
gst_tensor_copy (const GstTensor * tensor)

Create a copy of tensor.

Parameters:

tensor ( [transfer: none][nullable])

a GstTensor to be copied

Returns ( [transfer: full][nullable])

a new GstTensor

Since : 1.26


GstAnalytics.Tensor.prototype.copy

function GstAnalytics.Tensor.prototype.copy(): {
    // javascript wrapper for 'gst_tensor_copy'
}

Create a copy of tensor.

Parameters:

tensor (GstAnalytics.Tensor)

a GstAnalytics.Tensor to be copied

Since : 1.26


GstAnalytics.Tensor.copy

def GstAnalytics.Tensor.copy (self):
    #python wrapper for 'gst_tensor_copy'

Create a copy of tensor.

Parameters:

tensor (GstAnalytics.Tensor)

a GstAnalytics.Tensor to be copied

Since : 1.26


gst_tensor_free

gst_tensor_free (GstTensor * tensor)

Free tensor

Parameters:

tensor ( [in][transfer: full])

pointer to tensor to free

Since : 1.26


GstAnalytics.Tensor.prototype.free

function GstAnalytics.Tensor.prototype.free(): {
    // javascript wrapper for 'gst_tensor_free'
}

Free tensor

Parameters:

tensor (GstAnalytics.Tensor)

pointer to tensor to free

Since : 1.26


GstAnalytics.Tensor.free

def GstAnalytics.Tensor.free (self):
    #python wrapper for 'gst_tensor_free'

Free tensor

Parameters:

tensor (GstAnalytics.Tensor)

pointer to tensor to free

Since : 1.26


gst_tensor_get_dims

gsize *
gst_tensor_get_dims (GstTensor * tensor,
                     gsize * num_dims)

Gets the dimensions of the tensor.

Parameters:

tensor

a GstTensor

num_dims ( [out])

The number of dimensions

Returns ( [arraylength=num_dims][transfer: none])

The dims array form the tensor

Since : 1.26


GstAnalytics.Tensor.prototype.get_dims

function GstAnalytics.Tensor.prototype.get_dims(): {
    // javascript wrapper for 'gst_tensor_get_dims'
}

Gets the dimensions of the tensor.

Parameters:

Returns a tuple made of:

([ Number ] )

The dims array form the tensor

num_dims (Number )

The dims array form the tensor

Since : 1.26


GstAnalytics.Tensor.get_dims

def GstAnalytics.Tensor.get_dims (self):
    #python wrapper for 'gst_tensor_get_dims'

Gets the dimensions of the tensor.

Parameters:

Returns a tuple made of:

([ int ] )

The dims array form the tensor

num_dims (int )

The dims array form the tensor

Since : 1.26


Functions

gst_tensor_data_type_get_name

const gchar *
gst_tensor_data_type_get_name (GstTensorDataType data_type)

Get a string version of the data type

Parameters:

data_type

a GstTensorDataType

Returns

a constant string with the name of the data type

Since : 1.28


GstAnalytics.Tensor.prototype.data_type_get_name

function GstAnalytics.Tensor.prototype.data_type_get_name(data_type: GstAnalytics.TensorDataType): {
    // javascript wrapper for 'gst_tensor_data_type_get_name'
}

Get a string version of the data type

Returns (String)

a constant string with the name of the data type

Since : 1.28


GstAnalytics.Tensor.data_type_get_name

def GstAnalytics.Tensor.data_type_get_name (data_type):
    #python wrapper for 'gst_tensor_data_type_get_name'

Get a string version of the data type

Returns (str)

a constant string with the name of the data type

Since : 1.28


Enumerations

GstTensorDataType

Describe the type of data contain in the tensor.

Members
GST_TENSOR_DATA_TYPE_INT4 (0) –

signed 4 bit integer tensor data

GST_TENSOR_DATA_TYPE_INT8 (1) –

signed 8 bit integer tensor data

GST_TENSOR_DATA_TYPE_INT16 (2) –

signed 16 bit integer tensor data

GST_TENSOR_DATA_TYPE_INT32 (3) –

signed 32 bit integer tensor data

GST_TENSOR_DATA_TYPE_INT64 (4) –

signed 64 bit integer tensor data

GST_TENSOR_DATA_TYPE_UINT4 (5) –

unsigned 4 bit integer tensor data

GST_TENSOR_DATA_TYPE_UINT8 (6) –

unsigned 8 bit integer tensor data

GST_TENSOR_DATA_TYPE_UINT16 (7) –

unsigned 16 bit integer tensor data

GST_TENSOR_DATA_TYPE_UINT32 (8) –

unsigned 32 bit integer tensor data

GST_TENSOR_DATA_TYPE_UINT64 (9) –

unsigned 64 bit integer tensor data

GST_TENSOR_DATA_TYPE_FLOAT16 (10) –

16 bit floating point tensor data

GST_TENSOR_DATA_TYPE_FLOAT32 (11) –

32 bit floating point tensor data

GST_TENSOR_DATA_TYPE_FLOAT64 (12) –

64 bit floating point tensor data

GST_TENSOR_DATA_TYPE_BFLOAT16 (13) –

"brain" 16 bit floating point tensor data

GST_TENSOR_DATA_TYPE_STRING (14) –

UTF-8 string

(Since: 1.28)
GST_TENSOR_DATA_TYPE_BOOL (15) –

A boolean value stored in 1 byte.

(Since: 1.28)
GST_TENSOR_DATA_TYPE_COMPLEX64 (16) –

A 64-bit complex number stored in 2 32-bit values.

(Since: 1.28)
GST_TENSOR_DATA_TYPE_COMPLEX128 (17) –

A 128-bit complex number stored in 2 64-bit values.

(Since: 1.28)
GST_TENSOR_DATA_TYPE_FLOAT8E4M3FN (18) –

A non-IEEE 8-bit floating point format with 4 exponent bits and 3 mantissa bits, with NaN and no infinite values (FN). See this paper for more details

(Since: 1.28)
GST_TENSOR_DATA_TYPE_FLOAT8E4M3FNUZ (19) –

A non-IEEE 8-bit floating point format with 4 exponent bits and 3 mantissa bits, with NaN, no infinite values (FN) and no negative zero (UZ). See this paper for more details

(Since: 1.28)
GST_TENSOR_DATA_TYPE_FLOAT8E5M2 (20) –

A non-IEEE 8-bit floating point format with 5 exponent bits and 2 mantissa bits. See this paper for more details

(Since: 1.28)
GST_TENSOR_DATA_TYPE_FLOAT8E5M2FNUZ (21) –

A non-IEEE 8-bit floating point format with 5 exponent bits and 2 mantissa bits, with NaN, no infinite values (FN) and no negative zero (UZ). See this paper for more details

(Since: 1.28)

Since : 1.26


GstAnalytics.TensorDataType

Describe the type of data contain in the tensor.

Members
GstAnalytics.TensorDataType.INT4 (0) –

signed 4 bit integer tensor data

GstAnalytics.TensorDataType.INT8 (1) –

signed 8 bit integer tensor data

GstAnalytics.TensorDataType.INT16 (2) –

signed 16 bit integer tensor data

GstAnalytics.TensorDataType.INT32 (3) –

signed 32 bit integer tensor data

GstAnalytics.TensorDataType.INT64 (4) –

signed 64 bit integer tensor data

GstAnalytics.TensorDataType.UINT4 (5) –

unsigned 4 bit integer tensor data

GstAnalytics.TensorDataType.UINT8 (6) –

unsigned 8 bit integer tensor data

GstAnalytics.TensorDataType.UINT16 (7) –

unsigned 16 bit integer tensor data

GstAnalytics.TensorDataType.UINT32 (8) –

unsigned 32 bit integer tensor data

GstAnalytics.TensorDataType.UINT64 (9) –

unsigned 64 bit integer tensor data

GstAnalytics.TensorDataType.FLOAT16 (10) –

16 bit floating point tensor data

GstAnalytics.TensorDataType.FLOAT32 (11) –

32 bit floating point tensor data

GstAnalytics.TensorDataType.FLOAT64 (12) –

64 bit floating point tensor data

GstAnalytics.TensorDataType.BFLOAT16 (13) –

"brain" 16 bit floating point tensor data

GstAnalytics.TensorDataType.STRING (14) –

UTF-8 string

(Since: 1.28)
GstAnalytics.TensorDataType.BOOL (15) –

A boolean value stored in 1 byte.

(Since: 1.28)
GstAnalytics.TensorDataType.COMPLEX64 (16) –

A 64-bit complex number stored in 2 32-bit values.

(Since: 1.28)
GstAnalytics.TensorDataType.COMPLEX128 (17) –

A 128-bit complex number stored in 2 64-bit values.

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E4M3FN (18) –

A non-IEEE 8-bit floating point format with 4 exponent bits and 3 mantissa bits, with NaN and no infinite values (FN). See this paper for more details

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E4M3FNUZ (19) –

A non-IEEE 8-bit floating point format with 4 exponent bits and 3 mantissa bits, with NaN, no infinite values (FN) and no negative zero (UZ). See this paper for more details

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E5M2 (20) –

A non-IEEE 8-bit floating point format with 5 exponent bits and 2 mantissa bits. See this paper for more details

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E5M2FNUZ (21) –

A non-IEEE 8-bit floating point format with 5 exponent bits and 2 mantissa bits, with NaN, no infinite values (FN) and no negative zero (UZ). See this paper for more details

(Since: 1.28)

Since : 1.26


GstAnalytics.TensorDataType

Describe the type of data contain in the tensor.

Members
GstAnalytics.TensorDataType.INT4 (0) –

signed 4 bit integer tensor data

GstAnalytics.TensorDataType.INT8 (1) –

signed 8 bit integer tensor data

GstAnalytics.TensorDataType.INT16 (2) –

signed 16 bit integer tensor data

GstAnalytics.TensorDataType.INT32 (3) –

signed 32 bit integer tensor data

GstAnalytics.TensorDataType.INT64 (4) –

signed 64 bit integer tensor data

GstAnalytics.TensorDataType.UINT4 (5) –

unsigned 4 bit integer tensor data

GstAnalytics.TensorDataType.UINT8 (6) –

unsigned 8 bit integer tensor data

GstAnalytics.TensorDataType.UINT16 (7) –

unsigned 16 bit integer tensor data

GstAnalytics.TensorDataType.UINT32 (8) –

unsigned 32 bit integer tensor data

GstAnalytics.TensorDataType.UINT64 (9) –

unsigned 64 bit integer tensor data

GstAnalytics.TensorDataType.FLOAT16 (10) –

16 bit floating point tensor data

GstAnalytics.TensorDataType.FLOAT32 (11) –

32 bit floating point tensor data

GstAnalytics.TensorDataType.FLOAT64 (12) –

64 bit floating point tensor data

GstAnalytics.TensorDataType.BFLOAT16 (13) –

"brain" 16 bit floating point tensor data

GstAnalytics.TensorDataType.STRING (14) –

UTF-8 string

(Since: 1.28)
GstAnalytics.TensorDataType.BOOL (15) –

A boolean value stored in 1 byte.

(Since: 1.28)
GstAnalytics.TensorDataType.COMPLEX64 (16) –

A 64-bit complex number stored in 2 32-bit values.

(Since: 1.28)
GstAnalytics.TensorDataType.COMPLEX128 (17) –

A 128-bit complex number stored in 2 64-bit values.

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E4M3FN (18) –

A non-IEEE 8-bit floating point format with 4 exponent bits and 3 mantissa bits, with NaN and no infinite values (FN). See this paper for more details

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E4M3FNUZ (19) –

A non-IEEE 8-bit floating point format with 4 exponent bits and 3 mantissa bits, with NaN, no infinite values (FN) and no negative zero (UZ). See this paper for more details

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E5M2 (20) –

A non-IEEE 8-bit floating point format with 5 exponent bits and 2 mantissa bits. See this paper for more details

(Since: 1.28)
GstAnalytics.TensorDataType.FLOAT8E5M2FNUZ (21) –

A non-IEEE 8-bit floating point format with 5 exponent bits and 2 mantissa bits, with NaN, no infinite values (FN) and no negative zero (UZ). See this paper for more details

(Since: 1.28)

Since : 1.26


GstTensorDimOrder

Indicate to read tensor from memory in row-major or column-major order.

Members
GST_TENSOR_DIM_ORDER_ROW_MAJOR (0) –

elements along a row are consecutive in memory

GST_TENSOR_DIM_ORDER_COL_MAJOR (1) –

elements along a column are consecutive in memory

Since : 1.26


GstAnalytics.TensorDimOrder

Indicate to read tensor from memory in row-major or column-major order.

Members
GstAnalytics.TensorDimOrder.ROW_MAJOR (0) –

elements along a row are consecutive in memory

GstAnalytics.TensorDimOrder.COL_MAJOR (1) –

elements along a column are consecutive in memory

Since : 1.26


GstAnalytics.TensorDimOrder

Indicate to read tensor from memory in row-major or column-major order.

Members
GstAnalytics.TensorDimOrder.ROW_MAJOR (0) –

elements along a row are consecutive in memory

GstAnalytics.TensorDimOrder.COL_MAJOR (1) –

elements along a column are consecutive in memory

Since : 1.26


GstTensorLayout

Indicate tensor storage in memory.

Members
GST_TENSOR_LAYOUT_CONTIGUOUS (0) –

indicate the tensor is stored in a dense format in memory

Since : 1.26


GstAnalytics.TensorLayout

Indicate tensor storage in memory.

Members
GstAnalytics.TensorLayout.TENSOR_LAYOUT_CONTIGUOUS (0) –

indicate the tensor is stored in a dense format in memory

Since : 1.26


GstAnalytics.TensorLayout

Indicate tensor storage in memory.

Members
GstAnalytics.TensorLayout.TENSOR_LAYOUT_CONTIGUOUS (0) –

indicate the tensor is stored in a dense format in memory

Since : 1.26


The results of the search are