updated some errors from previous pr on adapting nearest interpolation
This commit is contained in:
@@ -14,6 +14,7 @@ _????-??-??_
|
||||
|
||||
* Bump minimum Armadillo version to 10.8 (#3760).
|
||||
|
||||
* Adapt `NearestInterpolation` ANN layer to new Layer Inteface
|
||||
## mlpack 4.4.0
|
||||
|
||||
_2024-05-26_
|
||||
|
||||
@@ -36,7 +36,8 @@ class NearestInterpolationType : public Layer<MatType>
|
||||
NearestInterpolationType();
|
||||
|
||||
/**Create NearestInterpolation Object with the same scaleFactor along
|
||||
* each dimension
|
||||
* each dimension.
|
||||
* NOTE: Currently this only supports 2 scaleFactors, and we plan to generalize to 1d, 2d and 3d in the future.
|
||||
*
|
||||
* @param scaleFactor Scale factors to scale each dimension by.
|
||||
*/
|
||||
|
||||
@@ -149,8 +149,8 @@ void NearestInterpolationType<MatType>::Backward(
|
||||
template<typename MatType>
|
||||
void NearestInterpolationType<MatType>::ComputeOutputDimensions()
|
||||
{
|
||||
if (this->inputDimensions.size() - 1 != scaleFactors.size()) {
|
||||
throw std::runtime_error("Scale factors must match number of rows and columns.");
|
||||
if (this->inputDimensions.size() < scaleFactors.size()) {
|
||||
throw std::runtime_error("Insufficient number of input dimensions.");
|
||||
}
|
||||
this->outputDimensions = this->inputDimensions;
|
||||
for (size_t i = 0; i < this->InputDimensions().size()-1; i++)
|
||||
|
||||
Reference in New Issue
Block a user