Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • 合并请求
  • !23445

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板

Api/Op (select_input/select_ouput) error message enhancement. !23445

  • Report abuse
!23445 已合并 4月 03, 2020 由 saxon_zh@saxon_zh 创建
#<User:0x00007fed677cf568>
  • 概览 4
  • 提交 3
  • 变更 5

Created by: liym27

select_input/select_output op报错信息增强

def select_input(inputs, mask)
def select_output(input, outputs, mask)

因为这2个接口的单测在同一文件,且通用之处较多,所以在同一个PR中修改。

Op shape报错检查增强

一、 Python API的input类型检查

1. 「select_input」的输入「inputs」的类型是tuple/list

  • 修改后报错:
TypeError: The type of 'inputs' in select_input must be (<type 'list'>, <type 'tuple'>), but received <type 'int'>. 

2. 「select_input」的输入「mask」的类型是Variable,dtype是int32/int64

  • 修改后报错:
TypeError: The type of 'mask' in select_input must be <class 'paddle.fluid.framework.Variable'>, but received <type 'int'>. 

TypeError: The data type of 'mask' in select_input must be ['int32'], but received float32. 

3. 「select_output」的输入「input」的类型是Variable

  • 修改后报错:
TypeError: The type of 'input' in select_output must be <class 'paddle.fluid.framework.Variable'>, but received <type 'int'>. 

4. 「select_output」的输入「mask」的类型是Variable,dtype是int32/int64

  • 修改后报错:
TypeError: The type of 'mask' in select_output must be <class 'paddle.fluid.framework.Variable'>, but received <type 'int'>. 

TypeError: The data type of 'mask' in select_output must be ['int32'], but received float32. 

5. 「select_output」的输入「outputs」的类型是list/tuple

  • 修改后报错:
TypeError: The type of 'outputs' in select_output must be (<type 'list'>, <type 'tuple'>), but received <class 'paddle.fluid.framework.Variable'>. 

二、 c++不合规报错检查增强

1.Mask数据比Inputs的size大时:

  • 修改前报错:报错内容没有打印数据信息
Selected branch number is greater than actual branch num in SelectInputOp
  • 修改后报错
InvalidArgumentError: Input 'Mask' in SelectInputOp is invalid. 'Mask' must be less than the size of input vector 'X'. But received Mask = 10, X's size = 2.

2. Mask的数据元素个数不等于1时:

  • 修改前报错:报错内容没有打印数据信息
Mask in SelectOutputOp must have numel 1.
  • 修改后报错:
InvalidArgumentError: Mask in SelectInputOp or SelectOutputOp must have numel 1. But received 2, and it's shape is [2].

3.Mask数据比Out的size大时:

  • 修改前报错:报错内容没有打印数据信息
Selected branch number is greater than actual branch num in num in SelectOutputOp
  • 修改后报错
InvalidArgumentError: Input 'Mask' in SelectOutputOp is invalid. 'Mask' must be less than the size of output vector 'Out'. But received Mask = 10, Out's size = 2.
指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/Paddle!23445
Source branch: github/fork/liym27/eme_op_select_input
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7