MemoryConfig Constructor
Description
Constructs an object of class MemoryConfig for configuring system memory handling.
Prototype
def __init__(self, atomic_clean_policy=0, static_memory_policy=0 )
Options
Option |
Input/Output |
Description |
|---|---|---|
atomic_clean_policy |
Input |
Whether to clean up the memory occupied by all operators with the memset attribute (memset operators) on the network. The options are as follows:
|
static_memory_policy |
Input |
Memory allocation mode used during network running.
The default value is 0. NOTE:
|
Returns
An object of the MemoryConfig class, as an argument passed to the NPURunConfig call.
Restrictions
None
Examples
1 2 3 4 5 | from npu_bridge.npu_init import * ... mem_config = MemoryConfig(atomic_clean_policy=0, static_memory_policy=0) session_config=tf.ConfigProto(allow_soft_placement=True) config = NPURunConfig(memory_config=mem_config, session_config=session_config) |
Parent topic: npu_bridge.estimator.npu.npu_config