create_const_float
Applicable Products
All processors
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 of the float, float list, or int type, 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.
Parent topic: GraphBuilder