From 044ff96ba3936529e4b79c10c2f6e54fa8657202 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Sat, 23 Mar 2019 20:44:43 -0700 Subject: [PATCH] Qualify calls to some functions from . PiperOrigin-RevId: 239989259 --- .../lite/toco/graph_transformations/propagate_fixed_sizes.cc | 5 +++-- .../toco/graph_transformations/resolve_constant_binary.cc | 5 +++-- .../toco/graph_transformations/resolve_constant_range.cc | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tensorflow/lite/toco/graph_transformations/propagate_fixed_sizes.cc b/tensorflow/lite/toco/graph_transformations/propagate_fixed_sizes.cc index 870e05094ce..aac38eb5755 100644 --- a/tensorflow/lite/toco/graph_transformations/propagate_fixed_sizes.cc +++ b/tensorflow/lite/toco/graph_transformations/propagate_fixed_sizes.cc @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include +#include #include #include #include @@ -1683,8 +1684,8 @@ void ProcessStridedSliceOperator(Model* model, StridedSliceOperator* op) { strided_slice_params, ToRuntimeShape(input_array.shape()), axis, start_index); - int dim_size = - ceil(static_cast(stop_index - start_index) / op->strides[axis]); + int dim_size = std::ceil(static_cast(stop_index - start_index) / + op->strides[axis]); CHECK_GT(dim_size, 0) << "Output size for an axis must be greater than 0. Axis " << axis diff --git a/tensorflow/lite/toco/graph_transformations/resolve_constant_binary.cc b/tensorflow/lite/toco/graph_transformations/resolve_constant_binary.cc index 0e1671c61c6..599e547f21f 100644 --- a/tensorflow/lite/toco/graph_transformations/resolve_constant_binary.cc +++ b/tensorflow/lite/toco/graph_transformations/resolve_constant_binary.cc @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include +#include #include #include #include @@ -142,9 +143,9 @@ void EvaluateBinaryOperatorOnConstantInputs(Model* model, } else if (binary_op->type == OperatorType::kDiv) { outval = val0 / val1; } else if (binary_op->type == OperatorType::kFloorDiv) { - outval = floor(val0 / val1); + outval = std::floor(val0 / val1); } else if (binary_op->type == OperatorType::kFloorMod) { - outval = val0 - (floor(val0 / val1) * val1); + outval = val0 - (std::floor(val0 / val1) * val1); } else if (binary_op->type == OperatorType::kMinimum) { outval = std::min(val0, val1); } else if (binary_op->type == OperatorType::kMaximum) { diff --git a/tensorflow/lite/toco/graph_transformations/resolve_constant_range.cc b/tensorflow/lite/toco/graph_transformations/resolve_constant_range.cc index 4cb27d97ec1..2310ab48d6e 100644 --- a/tensorflow/lite/toco/graph_transformations/resolve_constant_range.cc +++ b/tensorflow/lite/toco/graph_transformations/resolve_constant_range.cc @@ -12,10 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include +#include "tensorflow/core/platform/logging.h" #include "tensorflow/lite/toco/graph_transformations/graph_transformations.h" #include "tensorflow/lite/toco/model.h" #include "tensorflow/lite/toco/tooling_util.h" -#include "tensorflow/core/platform/logging.h" namespace toco { @@ -35,7 +36,7 @@ void FillRangeOutput(const Array& start_array, const Array& limit_array, for (int i = 0; i < size; ++i) { buffer.data.push_back(start + i * delta); } - CHECK_EQ(floor((limit - start) / delta), buffer.data.size()); + CHECK_EQ(std::floor((limit - start) / delta), buffer.data.size()); CHECK_EQ(buffer.data.size(), output_array->shape().dims()[0]); }