CreateScalar

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function Usage

Creates a scalar constant.

Prototype

  • Create a scalar constant of the int64 type.
    1
    EsTensorHolder CreateScalar(int64_t value)
    
  • Create a scalar constant of the int32 type.
    1
    EsTensorHolder CreateScalar(int32_t value)
    
  • Create a scalar constant of the uint64 type.
    1
    EsTensorHolder CreateScalar(uint64_t value)
    
  • Create a scalar constant of the uint32 type.
    1
    EsTensorHolder CreateScalar(uint32_t value)
    
  • Create a scalar constant of the float type.
    1
    EsTensorHolder CreateScalar(float value)
    

Parameters

Parameter

Input/Output

Description

value

Input

Scalar value.

Returns

Parameter

Type

Description

-

EsTensorHolder

Created scalar tensor holder. If the creation fails, an invalid EsTensorHolder is returned.

Constraints

None

Examples

1
2
EsGraphBuilder builder("test_graph");
auto s1 = builder.CreateScalar(int64_t(42));