Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Add Op UnitTest for logical_and #1396

Merged
merged 6 commits into from
Jun 26, 2023

Conversation

huajiao-hjyp
Copy link
Contributor

@huajiao-hjyp huajiao-hjyp commented May 6, 2023

描述

logical_and 算子增加单测文件

算子类型

  • ElementWise:输入张量索引和输出张量索引之间存在一对一的对应关系
  • Broadcast:输入张量索引和输出张量索引之间存在一对多的对应关系
  • Injective:单射算子,可以将一个输出 axis 映射到一个输入 axis
  • Reduction:输入张量索引和输出张量索引之间存在多对一的对应关系
  • OutFusible:复杂算子,仍然可以将一对一的算子融合到其输出中。
  • kNonFusible:无法融合的算子

OpMapper

Test Cases Checklist

张量维度

  • 1D 张量
  • 2D 张量
  • 3D 张量
  • 4D 张量
  • 5D 张量

special shape
挑选 2D/3D/4D 张量中的一个,测试下面的特殊情况。

  • 其中一个维度为 1
  • 其中一个维度小于 1024
  • 其中一个维度大于 1024
  • 向量的所有维度都是 1

张量数据类型

  • bool
  • int16
  • int32
  • int64
  • float32
  • float64

广播

  • 这个算子是否支持广播?
  • 广播的测试样例

算子属性

算子属性的测试用例。

  • 属性:属性类型-可取值
    • axis: -1

@paddle-bot
Copy link

paddle-bot bot commented May 6, 2023

Thanks for your contribution!

@huajiao-hjyp huajiao-hjyp changed the title Add Op UnitTest for logical_and test Add Op UnitTest for logical_and May 6, 2023
@huajiao-hjyp
Copy link
Contributor Author

@FisherWY 您好,对于And只支持bool类型的问题,使用了Expr.as_bool()进行转换,看日志目前的CI好像还没有进行到测试代码就报错了,想确认一下是修改代码的问题还是CI的偶然报错呢,谢谢~

@FisherWY
Copy link
Contributor

是修改代码的问题,可以搭建一个本地的测试环境进行编译和测试,链接

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label May 17, 2023
@FisherWY
Copy link
Contributor

@Tomoko-hjf logical系列算子现已支持更多数据类型了,可以合并一下主分支再跑CI看看,另外两个PR也相同,这里不再重复。

git fetch origin
git merge origin/develop
git push

Copy link
Collaborator

@thisjiang thisjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thisjiang thisjiang merged commit 672c092 into PaddlePaddle:develop Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants