IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

UnsqueezeShape

struct UnsqueezeShape

Registers the mo.unsqueeze_shape graph op with the graph compiler.

Implemented traitsโ€‹

AnyType, Deinitable, Movable

Methodsโ€‹

executeโ€‹

static def execute[target: StringSpan[ImmStaticOrigin], dtype: DType, indices_type: DType](output_shape: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=output_shape.static_spec], input_shape: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input_shape.static_spec], padding_indices: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=padding_indices.static_spec], ctx: DeviceContextBase)

Inserts size-1 dimensions into input_shape at padding_indices.

Raises:

If the GPU kernel launch fails.

Was this page helpful?