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

Method condition

python/paddle/base/framework.py:7587–7597  ·  view source on GitHub ↗
(var)

Source from the content-addressed store, hash-verified

7585 return False
7586
7587 def condition(var):
7588 if mode == "param":
7589 return is_parameter(var)
7590 elif mode == "opt":
7591 return is_belong_to_optimizer(var)
7592 elif mode == "all":
7593 return is_parameter(var) or is_belong_to_optimizer(var)
7594 else:
7595 raise ValueError(
7596 f"`mode` string should be 'param', 'opt' or 'all', but received {mode}."
7597 )
7598
7599 var_list = filter(condition, self.list_vars())
7600

Callers 15

VisitExprFunction · 0.80
MutateExprFunction · 0.80
VisitStmtMethod · 0.80
VisitStmtMethod · 0.80
CollectIRNodesFunction · 0.80
VisitStmtMethod · 0.80
VisitStmtMethod · 0.80
JudgeIfStmtFunction · 0.80
IsIfWithEqCondFunction · 0.80
AppendContinuousIfCondFunction · 0.80
VisitStmtMethod · 0.80
RunMethod · 0.80

Calls 3

is_parameterFunction · 0.85
is_belong_to_optimizerFunction · 0.85
ValueErrorClass · 0.85

Tested by

no test coverage detected