create_const_float

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

Atlas inference product

Atlas training product

Function Usage

Creates a float constant tensor.

Prototype

1
create_const_float(value: Union[float, List[float]], shape: Optional[List[int]] = None) -> TensorHolder

Parameters

Parameter

Input/Output

Description

value

Input

A single floating-point number or a list of floating-point numbers.

shape

Input

(Optional) Shape dimension.

Returns

(TensorHolder) Tensor holder of the constant.

Restrictions

  • If it is a list and the shape is provided, the number of elements must match the product of the shape dimensions.
  • If the value is not a float or float list, TypeError is thrown.
  • If the number of values does not match the shape, ValueError is thrown.
  • If the constant fails to be created, RuntimeError is thrown.