已合并
fix: 适配CreateConst API移除dtype/format参数的兼容性修复 #3187
liangtongxue创建于 6月8日
fix: 适配CreateConst API移除dtype/format参数的兼容性修复 #3187
已合并
共 2 个文件变更+3-3
| @@ -230,10 +230,10 @@ GraphUniqPtr DropOutV3SplitFusionPass::CreateReplacement(const GNode &node) | |||
| 230 | auto rOffset = builder.CreateInput(4, "offset", info.offsetDtype, FORMAT_ND, info.offsetDims); | 230 | auto rOffset = builder.CreateInput(4, "offset", info.offsetDtype, FORMAT_ND, info.offsetDims); |
| 231 | 231 | ||
| 232 | std::vector<int64_t> shapeValue(info.xDims.size(), 0); | 232 | std::vector<int64_t> shapeValue(info.xDims.size(), 0); |
| 233 | - auto rShapeConst = builder.CreateConst(shapeValue, info.noiseShapeDims, DT_INT64, FORMAT_ND); | 233 | + auto rShapeConst = builder.CreateConst(shapeValue, info.noiseShapeDims); |
| 234 | std::vector<int64_t> seed1Value = {0}; | 234 | std::vector<int64_t> seed1Value = {0}; |
| 235 | std::vector<int64_t> seed1Dims = {1}; | 235 | std::vector<int64_t> seed1Dims = {1}; |
| 236 | - auto rSeed1 = builder.CreateConst(seed1Value, seed1Dims, DT_INT64, FORMAT_ND); | 236 | + auto rSeed1 = builder.CreateConst(seed1Value, seed1Dims); |
| 237 | 237 | ||
| 238 | auto genMask = es::StatelessDropOutGenMask(rShapeConst, rProb, rSeed, rSeed1, rOffset); | 238 | auto genMask = es::StatelessDropOutGenMask(rShapeConst, rProb, rSeed, rSeed1, rOffset); |
| 239 | auto doMask = es::DropOutDoMask(rX, genMask, rProb); | 239 | auto doMask = es::DropOutDoMask(rX, genMask, rProb); |
| @@ -167,7 +167,7 @@ std::unique_ptr<Graph> BernoulliFusionPass::Replacement(const std::unique_ptr<Ma | |||
| 167 | 167 | ||
| 168 | std::vector<int64_t> shapeValue = GetShapeDims(probDesc.GetShape()); | 168 | std::vector<int64_t> shapeValue = GetShapeDims(probDesc.GetShape()); |
| 169 | std::vector<int64_t> shapeDims = {static_cast<int64_t>(shapeValue.size())}; | 169 | std::vector<int64_t> shapeDims = {static_cast<int64_t>(shapeValue.size())}; |
| 170 | - auto rShape = replaceGraphBuilder.CreateConst(shapeValue, shapeDims, DT_INT64, FORMAT_ND); | 170 | + auto rShape = replaceGraphBuilder.CreateConst(shapeValue, shapeDims); |
| 171 | 171 | ||
| 172 | auto output = es::StatelessBernoulli(rShape, rProb, rSeed, rOffset, dtype); | 172 | auto output = es::StatelessBernoulli(rShape, rProb, rSeed, rOffset, dtype); |
| 173 | 173 | ||