tensor: Clarify meaning of the dimensions array in the docs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9325>
This commit is contained in:
Sebastian Dröge 2025-07-03 19:40:45 +03:00 committed by GStreamer Marge Bot
parent f91b272f20
commit d255ed96f0
2 changed files with 12 additions and 6 deletions

View File

@ -1468,7 +1468,10 @@ pixel to instance of an object is identified.</doc>
</constructor>
<constructor name="new_simple" c:identifier="gst_tensor_new_simple" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gsttensor.c">Allocates a new #GstTensor of @dims_order ROW_MAJOR or COLUMN_MAJOR and
with an interleaved layout</doc>
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]`.</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gsttensor.h"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gsttensor.c">A newly allocated #GstTensor</doc>
@ -1496,8 +1499,8 @@ with an interleaved layout</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
<parameter name="dims" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gsttensor.c">tensor dimensions. Value of 0 mean the
dimension is dynamic.</doc>
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gsttensor.c">size of tensor in each dimension.
A value of 0 means the dimension is dynamic.</doc>
<array length="4" zero-terminated="0" c:type="gsize*">
<type name="gsize" c:type="gsize"/>
</array>

View File

@ -91,11 +91,14 @@ size_for_elements (GstTensorDataType data_type, gsize elements)
* @data: (transfer full): #GstBuffer holding tensor data
* @dims_order: Indicate tensor dimension indexing order
* @num_dims: number of tensor dimensions
* @dims: (array length=num_dims): tensor dimensions. Value of 0 mean the
* dimension is dynamic.
* @dims: (array length=num_dims): size of tensor in each dimension.
* A value of 0 means the dimension is dynamic.
*
* Allocates a new #GstTensor of @dims_order ROW_MAJOR or COLUMN_MAJOR and
* with an interleaved layout
* 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]`.
*
* Returns: A newly allocated #GstTensor
*