Get the attribute dict. Returns: dict: The Operator's attribute dict, name->attr.
(self)
| 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 |
no test coverage detected