Skip to main content
Log in

Mojo function

sizeof

sizeof[type: AnyType, target: target = current_target()]() -> IntLiteral

Returns the size of (in bytes) of the type.

Parameters:

  • type (AnyType): The type in question.
  • target (target): The target architecture.

Returns:

The size of the type in bytes.

sizeof[type: DType, target: target = current_target()]() -> IntLiteral

Returns the size of (in bytes) of the dtype.

Parameters:

  • type (DType): The DType in question.
  • target (target): The target architecture.

Returns:

The size of the dtype in bytes.

Was this page helpful?