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

Method _is_optimize_op

python/paddle/base/framework.py:4051–4062  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4049 return attr_map
4050
4051 def _is_optimize_op(self):
4052 op_maker = core.op_proto_and_checker_maker
4053 OPTIMIZE = core.op_proto_and_checker_maker.OpRole.Optimize
4054
4055 if not self.desc.has_attr(op_maker.kOpRoleAttrName()):
4056 return False
4057
4058 op_role = self.desc.attr(op_maker.kOpRoleAttrName())
4059 if op_role & int(OPTIMIZE):
4060 return True
4061
4062 return False
4063
4064 def _is_backward_op(self):
4065 op_maker = core.op_proto_and_checker_maker

Callers 4

_get_targetsMethod · 0.45
_prune_programMethod · 0.45
_prune_with_inputMethod · 0.45
_check_program_oproleFunction · 0.45

Calls 2

has_attrMethod · 0.80
attrMethod · 0.45

Tested by

no test coverage detected