Transforms
eva.data.transforms.ArrayToTensor
Converts a numpy array to a torch tensor.
eva.data.transforms.ArrayToFloatTensor
eva.data.transforms.Pad2DTensor
Pads a 2D tensor to a fixed dimension accross the first dimension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pad_size |
int
|
The size to pad the tensor to. If the tensor is larger than this size, no padding will be applied. |
required |
pad_value |
int | float
|
The value to use for padding. |
float('-inf')
|
Source code in src/eva/core/data/transforms/padding/pad_2d_tensor.py
eva.data.transforms.SampleFromAxis
Samples n_samples entries from a tensor along a given axis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_samples |
int
|
The number of samples to draw. |
required |
seed |
int
|
The seed to use for sampling. |
42
|
axis |
int
|
The axis along which to sample. |
0
|