Skip to content

Commit 806564c

Browse files
committed
refine, test=develop
1 parent 2d4c9dc commit 806564c

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

paddle/fluid/framework/attribute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class OpAttrChecker {
423423
}
424424
}
425425

426-
AttributeMap GetAttrsDefaultValuesMap() const {
426+
AttributeMap GetDefaultAttrsMap() const {
427427
AttributeMap default_values_map;
428428
for (const auto& checker : attr_checkers_) {
429429
checker(&default_values_map, true, false);

paddle/fluid/framework/grad_op_desc_maker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class SingleGradOpMaker<imperative::OpBase>
241241
{
242242
imperative::TracedGradOp traced_grad_op(node);
243243
try {
244-
traced_grad_op.SetAttrDefaultMap(this->DefaultAttrsMap());
244+
traced_grad_op.SetDefaultAttrsMap(this->DefaultAttrsMap());
245245
this->Apply(&traced_grad_op);
246246
} catch (platform::EnforceNotMet& exception) {
247247
framework::AppendErrorOpHint(traced_grad_op.Type(), &exception);

paddle/fluid/framework/ir/op_compat_sensible_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ AttrCompat& AttrCompat::IsLeftDefault() {
6161
return *this;
6262
}
6363
const OpInfo& op_info = OpInfoMap::Instance().Get(op_name);
64-
const AttributeMap attrs = op_info.Checker()->GetAttrsDefaultValuesMap();
64+
const AttributeMap attrs = op_info.Checker()->GetDefaultAttrsMap();
6565
if (attrs.find(attr_name_) == attrs.end()) {
6666
LOG(WARNING) << "Op (" << op_name << ") has no default attr:" << attr_name_;
6767
conditions_.emplace_back([](const Attribute& attr) { return false; });

paddle/fluid/framework/type_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ using DygraphGradOpMakerFN =
7171
const imperative::NameVarBaseMap& /*var_base_map_in*/,
7272
const imperative::NameVarBaseMap& /*var_base_map_out*/,
7373
const framework::AttributeMap& /*attributes*/,
74-
const framework::AttributeMap& /*attributes default*/,
74+
const framework::AttributeMap& /*default attributes*/,
7575
const std::map<std::string, std::string>& /*inplace_map*/)>;
7676

7777
using InferVarTypeFN =

paddle/fluid/imperative/dygraph_grad_maker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ class TracedGradOp {
295295
return op_->SetAttrMap(attrs);
296296
}
297297

298-
void SetAttrDefaultMap(const framework::AttributeMap& attrs) {
299-
return op_->SetAttrDefaultMap(attrs);
298+
void SetDefaultAttrsMap(const framework::AttributeMap& attrs) {
299+
return op_->SetDefaultAttrsMap(attrs);
300300
}
301301

302302
void SetAttr(const std::string& name, const framework::Attribute& v) {

paddle/fluid/imperative/infer_shape_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class DygraphInferShapeContext : public framework::InferShapeContext {
3535
DygraphInferShapeContext(const NameVarMap<VarType>* in,
3636
const NameVarMap<VarType>* out,
3737
const framework::AttributeMap* attr,
38-
const framework::AttributeMap* attr_default,
38+
const framework::AttributeMap* default_attr,
3939
const std::string op_type)
4040
: var_base_map_in_(in),
4141
var_base_map_out_(out),
4242
attrs_(attr),
43-
default_attrs_(attr_default),
43+
default_attrs_(default_attr),
4444
op_type_(op_type) {}
4545

4646
bool HasInput(const std::string& name) const override {

paddle/fluid/imperative/infer_var_type_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ class RuntimeInferVarTypeContext : public framework::InferVarTypeContext {
3333
RuntimeInferVarTypeContext(const NameVarMap<VarType>& inputs,
3434
const NameVarMap<VarType>& outputs,
3535
const framework::AttributeMap& attrs_map,
36-
const framework::AttributeMap& attrs_map_default)
36+
const framework::AttributeMap& default_attrs_map)
3737
: InferVarTypeContext(nullptr, nullptr),
3838
inputs_(inputs),
3939
outputs_(outputs),
4040
attrs_(attrs_map),
41-
default_attrs_(attrs_map_default) {}
41+
default_attrs_(default_attrs_map) {}
4242

4343
virtual ~RuntimeInferVarTypeContext() {}
4444

paddle/fluid/imperative/op_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class OpBase {
103103

104104
void SetAttrMap(const framework::AttributeMap& attrs) { attrs_ = attrs; }
105105

106-
void SetAttrDefaultMap(const framework::AttributeMap& default_attrs) {
106+
void SetDefaultAttrsMap(const framework::AttributeMap& default_attrs) {
107107
default_attrs_ = &default_attrs;
108108
}
109109

paddle/fluid/imperative/tests/test_layer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class TestRuntimeInferVarTypeContext
4646
TestRuntimeInferVarTypeContext(
4747
const NameVarMap<VarType>& inputs, const NameVarMap<VarType>& outputs,
4848
const framework::AttributeMap& attrs_map,
49-
const framework::AttributeMap& attrs_map_default)
49+
const framework::AttributeMap& default_attrs_map)
5050
: RuntimeInferVarTypeContext<VarType>(inputs, outputs, attrs_map,
51-
attrs_map_default) {}
51+
default_attrs_map) {}
5252

5353
bool HasVar(const std::string& name) const {
5454
return RuntimeInferVarTypeContext<VarType>::HasVar(name);

paddle/fluid/pybind/pybind.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ All parameter, weight, gradient are variables in Paddle.
13081308
if (info != nullptr) {
13091309
if (info->HasOpProtoAndChecker()) {
13101310
auto op_checker = info->Checker();
1311-
res = op_checker->GetAttrsDefaultValuesMap();
1311+
res = op_checker->GetDefaultAttrsMap();
13121312
}
13131313
}
13141314
return res;

0 commit comments

Comments
 (0)