未验证 提交 5c607787 编写于 作者: W wangchaochaohu 提交者: GitHub

polish the code of fusion group test=develop (#23370)

上级 3ea7c59f
......@@ -77,6 +77,7 @@ std::vector<OperationExpression> CodeGenerator::ConvertToExpressions(
auto* op = node->Op();
AttributeMap attr = *(op->MutableAttrMap());
// Input ids should be set in fixed order, like:
// - X, Y in forward operations
// - X, Y, Out, out@GRAD in backward operations
std::vector<int> input_ids;
......
......@@ -20,11 +20,6 @@ limitations under the License. */
#include "glog/logging.h"
#include "paddle/fluid/framework/block_desc.h"
#include "paddle/fluid/framework/ir/fusion_group/operation.h"
#include "paddle/fluid/framework/op_call_stack.h"
#include "paddle/fluid/framework/op_proto_maker.h"
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/shape_inference.h"
#include "paddle/fluid/framework/var_type_inference.h"
namespace paddle {
......@@ -164,8 +159,7 @@ std::string OperationExpression::GetRHS(std::unordered_set<int>* used,
">. Received %d.",
index, op_type_, input_ids_[index]));
// TODO(wangchaochaohu): Here fp16 convert to float to do comupte, we
// need
// to add general fp16 compute later.
// need to add general fp16 compute later.
std::string var_name;
if (rhs_type_ == "float16") {
half2fp32_statement->append(OptimzeFP16RHS(used, index, input_ids_));
......
......@@ -199,7 +199,7 @@ void OperationMap::InsertMultivariateElementwiseOperations() {
auto insert_handler_without_input = [&](std::string op_type, std::string expr,
std::vector<std::string> grad_exprs) {
int type = 0;
int num_oprands = -1;
int num_oprands = 0;
Insert(type, num_oprands, op_type, expr, grad_exprs, {}, {"Out"});
};
// fill_constant:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册