Session Constructor and Destructor

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <ge/ge_api.h>
  • Library file: libge_runner.so

Function Usage

Constructs or destroys an object of class Session.

Prototype

APIs taking string arguments will be deprecated in future releases. Use APIs taking non-string arguments instead.

1
2
3
explicit Session(const std::map<std::string, std::string> &options)
explicit Session(const std::map<AscendString, AscendString> &options)
~Session()

Parameters

Parameter

Input/Output

Description

options

Input

A key-value mapping table, for the Session configuration. key indicates the parameter type, and value indicates the parameter value, both of type string.

Generally, this parameter can be left blank, indicating using the same options configuration passed to GEInitialize.

This parameter is available for configuring the current session separately. For its keys and values, see the parameters of the session level in Options.

Returns

None

Restrictions

Sessions cannot be executed concurrently. In addition, a session exclusively occupies resources. As such, creating multiple sessions concurrently may fail due to insufficient resources.