MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / all_attrs

Method all_attrs

python/paddle/base/framework.py:4027–4049  ·  view source on GitHub ↗

Get the attribute dict. Returns: dict: The Operator's attribute dict, name->attr.

(self)

Source from the content-addressed store, hash-verified

4025 return attr_vars
4026
4027 def all_attrs(self):
4028 """
4029 Get the attribute dict.
4030
4031 Returns:
4032 dict: The Operator's attribute dict, name->attr.
4033 """
4034 attr_names = self.attr_names
4035 attr_map = {}
4036 for n in attr_names:
4037 attr_type = self.desc.attr_type(n, True)
4038 if attr_type == core.AttrType.BLOCK:
4039 attr_map[n] = self._block_attr(n)
4040 elif attr_type == core.AttrType.BLOCKS:
4041 attr_map[n] = self._blocks_attr(n)
4042 elif attr_type == core.AttrType.VAR:
4043 attr_map[n] = self._var_attr(n)
4044 elif attr_type == core.AttrType.VARS:
4045 attr_map[n] = self._vars_attr(n)
4046 else:
4047 attr_map[n] = self.attr(n)
4048
4049 return attr_map
4050
4051 def _is_optimize_op(self):
4052 op_maker = core.op_proto_and_checker_maker

Callers 15

_rename_var_recursively_Function · 0.80
is_backward_opFunction · 0.80
is_optimize_opFunction · 0.80
is_lr_sched_opFunction · 0.80
is_loss_opFunction · 0.80
is_loss_grad_opFunction · 0.80
convert_to_graphMethod · 0.80
calc_time_by_cost_modelFunction · 0.80
get_startup_programMethod · 0.80
_append_pserver_opsMethod · 0.80

Calls 6

_block_attrMethod · 0.95
_blocks_attrMethod · 0.95
_var_attrMethod · 0.95
_vars_attrMethod · 0.95
attrMethod · 0.95
attr_typeMethod · 0.80

Tested by

no test coverage detected