Ai
1 Star 0 Fork 57

gice/tensorflow

forked from openEuler-RISC-V/tensorflow
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2021-37643.patch 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
starlet_dx 提交于 2021-08-31 15:06 +08:00 . fix the cves to tensorflow
From 482da92095c4d48f8784b1f00dda4f81c28d2988 Mon Sep 17 00:00:00 2001
From: Laura Pak <lpak@google.com>
Date: Mon, 2 Aug 2021 15:07:31 -0700
Subject: [PATCH] Ensure non-empty padding_value input to
tf.raw_ops.MatrixDiagPartV2, if a padding_value is input
PiperOrigin-RevId: 388314614
Change-Id: If0b51ad58d5d8543a6be6ce8f42ae4755c80d55f
---
tensorflow/core/kernels/matrix_diag_op.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tensorflow/core/kernels/matrix_diag_op.cc b/tensorflow/core/kernels/matrix_diag_op.cc
index b61dbe96a5d6a..1506df1712138 100644
--- a/tensorflow/core/kernels/matrix_diag_op.cc
+++ b/tensorflow/core/kernels/matrix_diag_op.cc
@@ -86,7 +86,10 @@ class MatrixDiagPartOp : public OpKernel {
upper_diag_index = diag_index.flat<int32>()(1);
}
}
- padding_value = context->input(2).flat<T>()(0);
+ const Tensor& padding_in = context->input(2);
+ OP_REQUIRES(context, padding_in.NumElements() == 1,
+ errors::InvalidArgument("Padding must be scalar."));
+ padding_value = padding_in.flat<T>()(0);
}
const TensorShape& input_shape = input.shape();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gice/tensorflow.git
git@gitee.com:gice/tensorflow.git
gice
tensorflow
tensorflow
master

搜索帮助