Add bool type for paddle::framework::Attribute
Created by: qingqing01
Even though we can use int
type to express bool
type. But if use int
type, some checking code in operators is as follow:
PADDLE_ENFORCE(ctx.Attr<int>("is_training") == 0 ||
ctx.Attr<int>("is_training") == 1);
And the bool type attributes are used frequently in operators. So, I think it's necessary to add bool type.