.. index:: pair: struct; dnnl_memory_desc_t .. _doxid-structdnnl__memory__desc__t: struct dnnl_memory_desc_t ========================= .. toctree:: :hidden: Overview ~~~~~~~~ Memory descriptor. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct dnnl_memory_desc_t { // fields int :ref:`ndims`; :ref:`dnnl_dims_t` :ref:`dims`; :ref:`dnnl_data_type_t` :ref:`data_type`; :ref:`dnnl_dims_t` :ref:`padded_dims`; :ref:`dnnl_dims_t` :ref:`padded_offsets`; :ref:`dnnl_dim_t` :ref:`offset0`; :ref:`dnnl_format_kind_t` :ref:`format_kind`; :ref:`dnnl_blocking_desc_t` :ref:`blocking`; :ref:`dnnl_wino_desc_t` :ref:`wino_desc`; :ref:`dnnl_rnn_packed_desc_t` :ref:`rnn_packed_desc`; union dnnl_memory_desc_t::@2 :target:`format_desc`; :ref:`dnnl_memory_extra_desc_t` :target:`extra`; }; .. _details-structdnnl__memory__desc__t: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Memory descriptor. The description is based on a number of dimensions, dimensions themselves, plus information about elements type and memory format. Additionally, contains format-specific descriptions of the data layout. Fields ------ .. index:: pair: variable; ndims .. _doxid-structdnnl__memory__desc__t_1a72ed50c98f23f513550255ca8917b473: .. ref-code-block:: cpp :class: doxyrest-title-code-block int ndims Number of dimensions. .. index:: pair: variable; dims .. _doxid-structdnnl__memory__desc__t_1a47052ab197c58af737ac2865796402ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_dims_t` dims Dimensions in the following order: * CNN data tensors: mini-batch, channel, spatial (``{N, C, [[D,] H,] W}``) * CNN weight tensors: group (optional), output channel, input channel, spatial (``{[G,] O, I, [[D,] H,] W}``) * RNN data tensors: time, mini-batch, channels (``{T, N, C}``) or layers, directions, states, mini-batch, channels (``{L, D, S, N, C}``) * RNN weight tensor: layers, directions, input channel, gates, output channels (``{L, D, I, G, O}``). .. note:: The order of dimensions does not depend on the memory format, so whether the data is laid out in :ref:`dnnl_nchw ` or :ref:`dnnl_nhwc ` the dims for 4D CN data tensor would be ``{N, C, H, W}``. .. index:: pair: variable; data_type .. _doxid-structdnnl__memory__desc__t_1a3b691a662b154a03f4e81a7c68b1b175: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_data_type_t` data_type Data type of the tensor elements. .. index:: pair: variable; padded_dims .. _doxid-structdnnl__memory__desc__t_1abd9c8bd4bc17b924e21b21ed919a52f9: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_dims_t` padded_dims Size of the data including padding in each dimension. .. index:: pair: variable; padded_offsets .. _doxid-structdnnl__memory__desc__t_1a7061897266dca53429b1ea3b8672218f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_dims_t` padded_offsets Per-dimension offset from the padding to actual data, the top-level tensor with offsets applied must lie within the padding area. .. index:: pair: variable; offset0 .. _doxid-structdnnl__memory__desc__t_1a20a5edce338892ffdba47f8f11ddfe91: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_dim_t` offset0 Offset from memory origin to the current block, non-zero only in a description of a memory sub-block. .. index:: pair: variable; format_kind .. _doxid-structdnnl__memory__desc__t_1ae6f8322c5cff0068a97e7fba2f123e2c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_format_kind_t` format_kind Memory format kind. .. index:: pair: variable; blocking .. _doxid-structdnnl__memory__desc__t_1a376a38353672131bfc67fe92bceb6c9e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_blocking_desc_t` blocking Description of the data layout for memory formats that use blocking. .. index:: pair: variable; wino_desc .. _doxid-structdnnl__memory__desc__t_1a17cbfada7a6188b0531ed563f44e6976: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_wino_desc_t` wino_desc Tensor of weights for integer 8bit winograd convolution. .. index:: pair: variable; rnn_packed_desc .. _doxid-structdnnl__memory__desc__t_1ac8e3fced428d7d7a762cddcbfadadbbf: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_rnn_packed_desc_t` rnn_packed_desc Tensor of packed weights for RNN.