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

Method persistable

python/paddle/base/framework.py:2338–2363  ·  view source on GitHub ↗

Indicating if we current Variable should be long-term alive **Notes: This Property will be deprecated and this API is just to help user understand concept** **1. All Variable's persistable is** ``False`` **except Parameters.** **2. In** Dygraph **mode, th

(self)

Source from the content-addressed store, hash-verified

2336
2337 @property
2338 def persistable(self):
2339 """
2340 Indicating if we current Variable should be long-term alive
2341
2342
2343 **Notes: This Property will be deprecated and this API is just to help user understand concept**
2344
2345 **1. All Variable's persistable is** ``False`` **except Parameters.**
2346
2347 **2. In** Dygraph **mode, this property should not be changed**
2348
2349 Examples:
2350 .. code-block:: pycon
2351
2352 >>> import paddle.base as base
2353 >>> cur_program = base.Program()
2354 >>> cur_block = cur_program.current_block()
2355 >>> new_variable = cur_block.create_var(
2356 ... name="X",
2357 ... shape=[-1, 23, 48],
2358 ... dtype="float32",
2359 ... )
2360 >>> print("persistable of current Var is: {}".format(new_variable.persistable))
2361 persistable of current Var is: False
2362 """
2363 return self.desc.persistable()
2364
2365 @persistable.setter
2366 def persistable(self, p):

Callers 15

_insert_funcMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
_copy_kwargsMethod · 0.45
_run_implMethod · 0.45
persistableMethod · 0.45
all_persistable_nodesMethod · 0.45
_is_persistableFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected