Constructor

Description

Creates a dimension expansion rule.

Prototype

  • In the constructed instance, the dimension expansion rule (mask_) and the expanded dimension (size_) are both 0.

    ExpandDimsType() : size_(0U), mask_(0U)

  • Creates a dimension expansion rule using a string.

    ExpandDimsType(const ge::char_t *const expand_dims_type)

  • Creates a dimension expansion rule based on the int64_t bit field definition.

    ExpandDimsType(const int64_t reshape_type_mask)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

expand_dims_type

Input

Dimension expansion rule described by a character string. The maximum length of the string is 56 bytes.

reshape_type_mask

Input

Dimension expansion rule of the int64_t type. The value contains 64 bits. For details about the bit field definition of int, see int64_t bit field definition.

For simplicity, the sequence of the dimension expansion rule is opposite to that of the string. For example, if the dimension expansion rule described by the string is "1100," the corresponding dimension expansion rule is "0011". When converted to a number, it represents the binary '0011', which is 3 in decimal. For details about concepts and description methods of dimension expansion rules, see Overview.

Table 2 Definitions about the int64_t bit field

Field

Type

Description

High-order 8 bits

uint8_t

Length of a dimension expansion rule.

Low-order 56 bits

Bit field

Dimension expansion rule described by 0 and 1.

Returns

An ExpandDimsType object

Restrictions

None

Example

ExpandDimsType type("1001"); // Set mask_ to 1001 and size_ to 4.