pulsatrix
Loading...
Searching...
No Matches
pulsatrix::ResizeTransform Class Reference

Every transform in this file operates on sample.fields[0], assumed to be an image Tensor of shape (1, channels, height, width) – the convention MnistDatasetAdapter, CsvDataset, and ImageDecoder all already share (image/features first, label last). More...

#include <image_transforms.hpp>

Inheritance diagram for pulsatrix::ResizeTransform:
Collaboration diagram for pulsatrix::ResizeTransform:

Public Member Functions

 ResizeTransform (int64_t target_height, int64_t target_width, DeviceBackend *backend)
 
Sample apply (Sample sample) const override
 Applies this transform to a sample.
 
- Public Member Functions inherited from pulsatrix::Transform
virtual ~Transform ()=default
 

Detailed Description

Every transform in this file operates on sample.fields[0], assumed to be an image Tensor of shape (1, channels, height, width) – the convention MnistDatasetAdapter, CsvDataset, and ImageDecoder all already share (image/features first, label last).

Nearest-neighbor resize to (target_height, target_width).

Note
Needs a DeviceBackend to allocate the differently-shaped output Tensor – unlike NormalizeTransform/HorizontalFlipTransform, which modify a same-shaped buffer in place and need no backend at all.

Constructor & Destructor Documentation

◆ ResizeTransform()

pulsatrix::ResizeTransform::ResizeTransform ( int64_t  target_height,
int64_t  target_width,
DeviceBackend *  backend 
)
inline

Member Function Documentation

◆ apply()

Sample pulsatrix::ResizeTransform::apply ( Sample  sample) const
overridevirtual

Applies this transform to a sample.

Parameters
sampleInput sample.
Returns
The transformed sample.

Implements pulsatrix::Transform.


The documentation for this class was generated from the following file: