replace floorf to std::floor.
notes: it's require "include <cmath>" on macOS clang.
@@ -100,12 +100,12 @@ Tensor ResizeHorizontal(Tensor &tensor, const int width,
const int height = srcHeight;
Tensor dstTensor = Tensor::zeros({height, width, channels});
float xScale = (float) width / (float) srcWidth;
- int xSrcWindow = floorf(1/xScale);
+ int xSrcWindow = std::floor(1/xScale);
xSrcWindow = 1; // Nearest
//xSrcWindow = (xSrcWindow < 2)? 2 :xSrcWindow; // Bi-Liner
for (int dstY = 0 ; dstY < height ; dstY++) {
for (int dstX = 0 ; dstX < width ; dstX++) {
- int srcX = (int) floorf(dstX/xScale);
+ int srcX = (int) std::floor(dstX/xScale);
int srcY = dstY;
for (int c = 0 ; c < channels ; c++) {
float v = 0.0;
@@ -139,13 +139,13 @@ Tensor ResizeVertical(Tensor &tensor, const int height,
const int width = srcWidth;
Tensor dstTensor = Tensor::zeros({height, width, channels});
float yScale = (float) height / (float) srcHeight;
- int ySrcWindow = floorf(1/yScale);
+ int ySrcWindow = std::floor(1/yScale);
ySrcWindow = 1; // Nearest
// ySrcWindow = (ySrcWindow < 2)? 2 :ySrcWindow; // Bi-Linear
for (int dstY = 0 ; dstY < height ; dstY++) {
for (int dstX = 0 ; dstX < width ; dstX++) {
int srcX = dstX;
- int srcY = (int) floorf(dstY/yScale);
+ int srcY = (int) std::floor(dstY/yScale);
for (int c = 0 ; c < channels ; c++) {
float v = 0.0;
float totalW = 0.0;
