[][src]Struct tensorflow_proto::tensorflow::ConfigProto

pub struct ConfigProto {
    pub device_count: HashMap<String, i32>,
    pub intra_op_parallelism_threads: i32,
    pub inter_op_parallelism_threads: i32,
    pub use_per_session_threads: bool,
    pub session_inter_op_thread_pool: Vec<ThreadPoolOptionProto>,
    pub placement_period: i32,
    pub device_filters: Vec<String>,
    pub gpu_options: Option<GpuOptions>,
    pub allow_soft_placement: bool,
    pub log_device_placement: bool,
    pub graph_options: Option<GraphOptions>,
    pub operation_timeout_in_ms: i64,
    pub rpc_options: Option<RpcOptions>,
    pub cluster_def: Option<ClusterDef>,
    pub isolate_session_state: bool,
    pub experimental: Option<Experimental>,
}

Session configuration parameters. The system picks appropriate values for fields that are not set.

Fields

device_count: HashMap<String, i32>

Map from device type name (e.g., "CPU" or "GPU" ) to maximum number of devices of that type to use. If a particular device type is not found in the map, the system picks an appropriate number.

intra_op_parallelism_threads: i32

The execution of an individual op (for some op types) can be parallelized on a pool of intra_op_parallelism_threads. 0 means the system picks an appropriate number.

inter_op_parallelism_threads: i32

Nodes that perform blocking operations are enqueued on a pool of inter_op_parallelism_threads available in each process.

0 means the system picks an appropriate number. Negative means all operations are performed in caller's thread.

Note that the first Session created in the process sets the number of threads for all future sessions unless use_per_session_threads is true or session_inter_op_thread_pool is configured.

use_per_session_threads: bool

If true, use a new set of threads for this session rather than the global pool of threads. Only supported by direct sessions.

If false, use the global threads created by the first session, or the per-session thread pools configured by session_inter_op_thread_pool.

This option is deprecated. The same effect can be achieved by setting session_inter_op_thread_pool to have one element, whose num_threads equals inter_op_parallelism_threads.

session_inter_op_thread_pool: Vec<ThreadPoolOptionProto>

This option is experimental - it may be replaced with a different mechanism in the future.

Configures session thread pools. If this is configured, then RunOptions for a Run call can select the thread pool to use.

The intended use is for when some session invocations need to run in a background pool limited to a small number of threads:

  • For example, a session may be configured to have one large pool (for regular compute) and one small pool (for periodic, low priority work); using the small pool is currently the mechanism for limiting the inter-op parallelism of the low priority work. Note that it does not limit the parallelism of work spawned by a single op kernel implementation.
  • Using this setting is normally not needed in training, but may help some serving use cases.
  • It is also generally recommended to set the global_name field of this proto, to avoid creating multiple large pools. It is typically better to run the non-low-priority work, even across sessions, in a single large pool.
placement_period: i32

Assignment of Nodes to Devices is recomputed every placement_period steps until the system warms up (at which point the recomputation typically slows down automatically).

device_filters: Vec<String>

When any filters are present sessions will ignore all devices which do not match the filters. Each filter can be partially specified, e.g. "/job:ps" "/job:worker/replica:3", etc.

gpu_options: Option<GpuOptions>

Options that apply to all GPUs.

allow_soft_placement: bool

Whether soft placement is allowed. If allow_soft_placement is true, an op will be placed on CPU if

  1. there's no GPU implementation for the OP or
  2. no GPU devices are known or registered or
  3. need to co-locate with reftype input(s) which are from CPU.
log_device_placement: bool

Whether device placements should be logged.

graph_options: Option<GraphOptions>

Options that apply to all graphs.

operation_timeout_in_ms: i64

Global timeout for all blocking operations in this session. If non-zero, and not overridden on a per-operation basis, this value will be used as the deadline for all blocking operations.

rpc_options: Option<RpcOptions>

Options that apply when this session uses the distributed runtime.

cluster_def: Option<ClusterDef>

Optional list of all workers to use in this session.

isolate_session_state: bool

If true, any resources such as Variables used in the session will not be shared with other sessions. However, when clusterspec propagation is enabled, this field is ignored and sessions are always isolated.

experimental: Option<Experimental>

Trait Implementations

impl Clone for ConfigProto[src]

impl Debug for ConfigProto[src]

impl Default for ConfigProto[src]

impl Message for ConfigProto[src]

impl PartialEq<ConfigProto> for ConfigProto[src]

impl StructuralPartialEq for ConfigProto[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.