Module Dtype.Image
type kind = image_kind = | Imageh| Imagef(*Image storage kind.
*)Imagehstores half-precision image elements;Imagefstores single-precision image elements. Both haveVal.float32as their loaded base dtype.
type t = Ptr.tImage dtype. Images are specialized Ptr.t values, matching tinygrad's ImageDType as a subclass of pointer dtype.
create kind shape is an image pointer dtype in Global address space with base Val.float32, size equal to the product of shape, pointer vector width 1, and image storage kind kind.
val imageh : int list -> timageh shape is create Imageh shape. It has priority 100, bitsize 16, base Val.float32, address space Global, and size = List.fold_left ( * ) 1 shape.
val imagef : int list -> timagef shape is create Imagef shape. It has priority 100, bitsize 32, base Val.float32, address space Global, and size = List.fold_left ( * ) 1 shape.
kind image is the image storage kind.
Raises Invalid_argument if image is not an image pointer dtype.
val shape : t -> int listshape image is the image shape.
Raises Invalid_argument if image is not an image pointer dtype.
base image is Val.float32.
Raises Invalid_argument if image is not an image pointer dtype.
val size : t -> intsize image is the product of shape.
Raises Invalid_argument if image is not an image pointer dtype.
val pitch : t -> intpitch image is the tinygrad row pitch in bytes, shape[1] * 4 * Ptr.itemsize image, with shape[1] rounded up to 256 pixels on macOS.
Raises Invalid_argument if image is not an image pointer dtype or has fewer than two dimensions.
val addrspace : t -> addr_spaceaddrspace image is Global.
Raises Invalid_argument if image is not an image pointer dtype.