Skip to main content
Log in

Mojo struct

ImageShape

@register_passable(trivial) struct ImageShape

A data-layout agnostic representation of tensor shapes used in conv2d.

Fields

  • N (Int):
  • C (Int):
  • H (Int):
  • W (Int):

Implemented traits

AnyType, Copyable, ExplicitlyCopyable, Movable, UnknownDestructibility

Methods

__init__

__init__[shape: DimList, type: DType, layout: Image2DLayout](image_data: ImageData[shape, type, layout, origin]) -> Self

Constructor of an ImageShape instance from an ImageData.

Args:

  • image_data (ImageData[shape, type, layout, origin]): The image data instance to extract shape info from.