tinygrad features.image
Note
You likely want the upstream tinygrad, not tinygrab. Tinygrab contains AI generated docstrings for a tinygrad snapshot. Upstream: https://tinygrad.org
- tinygrad.features.image.image_conv2d(self, weight, bias=None, groups=1, stride=1, dilation=1, padding=0)[source]
This function performs a 2D convolution operation on an input image.
- tinygrad.features.image.self
The input image array.
- Type:
ndarray
- tinygrad.features.image.weight
The filter weights for the convolution operation.
- Type:
ndarray
- tinygrad.features.image.bias
The biases for the convolution operation. Default is None.
- Type:
ndarray
- tinygrad.features.image.groups
The number of groups to split the input and output channels into. Default is 1.
- Type:
int
- tinygrad.features.image.stride
The stride of the convolution operation. Default is 1.
- Type:
int
- tinygrad.features.image.dilation
The spacing between the kernel points. Default is 1.
- Type:
int
- tinygrad.features.image.padding
The amount of padding to add to the input image. Default is 0.
- Type:
int
- Returns:
The result of the 2D convolution operation.
- Return type:
ndarray
- tinygrad.features.image.image_dot(self, w)[source]
Image dot function replacement.
This function is used to perform matrix multiplication between two tensors in a 2D convolutional context. It uses a 1x1 convolution to perform the operation.
- Arributes:
self (Tensor): The first input tensor. w (Tensor): The second input tensor.
- Returns:
The result of the matrix multiplication between self and w.
- Return type:
- Raises:
ValueError – If both arguments are not at least 1D.
ValueError – If the last dimension of self is not equal to the second-to-last dimension of w.
- tinygrad.features.image.to_image_idx(base_shape: Tuple[int, ...], idxy: Node, valid: Node) Tuple[Tuple[Node, Node], Node] [source]
This function takes a base shape, an idxy node, and a valid node as input. It returns a tuple of two nodes and one integer.
- tinygrad.features.image.base_shape
The base shape of the image.
- Type:
Tuple[int, …]