1 Star 0 Fork 56

gice/tensorflow

forked from openEuler-RISC-V/tensorflow
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-29580.patch 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
From 32fdcbff9d06d010d908fcc4bd4b36eb3ce15925 Mon Sep 17 00:00:00 2001
From: Mihai Maruseac <mihaimaruseac@google.com>
Date: Wed, 5 May 2021 22:39:29 -0700
Subject: [PATCH] Validate arguments of `FractionalMaxPoolGrad`
PiperOrigin-RevId: 372274982
Change-Id: If46b0c442efa4eaef635ce6a476717060420122c
---
tensorflow/core/kernels/fractional_max_pool_op.cc | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tensorflow/core/kernels/fractional_max_pool_op.cc b/tensorflow/core/kernels/fractional_max_pool_op.cc
index 619a3507ce415..1a2a783d135c5 100644
--- a/tensorflow/core/kernels/fractional_max_pool_op.cc
+++ b/tensorflow/core/kernels/fractional_max_pool_op.cc
@@ -235,6 +235,20 @@ class FractionalMaxPoolGradOp : public OpKernel {
// Just to make it similar to FractionalMaxPoolOp.
constexpr int tensor_in_and_out_dims = 4;
+ OP_REQUIRES(
+ context, tensor_in.dims() == tensor_in_and_out_dims,
+ errors::InvalidArgument("orig_input should be a tensor of rank 4, got ",
+ tensor_in.DebugString()));
+ OP_REQUIRES(context, tensor_in.NumElements() > 0,
+ errors::InvalidArgument("orig_input must not be empty, got ",
+ tensor_in.DebugString()));
+ OP_REQUIRES(context, tensor_out.dims() == tensor_in_and_out_dims,
+ errors::InvalidArgument(
+ "orig_output should be a tensor of rank 4, got ",
+ tensor_out.DebugString()));
+ OP_REQUIRES(context, tensor_out.NumElements() > 0,
+ errors::InvalidArgument("orig_output must not be empty, got ",
+ tensor_out.DebugString()));
std::vector<int64> input_size(tensor_in_and_out_dims);
std::vector<int64> output_size(tensor_in_and_out_dims);
for (int i = 0; i < tensor_in_and_out_dims; ++i) {
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gice/tensorflow.git
git@gitee.com:gice/tensorflow.git
gice
tensorflow
tensorflow
master

搜索帮助