openvino.runtime.opset13.constant

openvino.runtime.opset13.constant(value: Union[int, float, numpy.ndarray, numpy.number, bool, numpy.bool_, list], dtype: Union[type, numpy.dtype, openvino._pyopenvino.Type] = None, name: Optional[str] = None, *, shared_memory: bool = False) openvino._pyopenvino.op.Constant

Create a Constant node from provided value.

Parameters
  • value – One of: array of values or scalar to initialize node with.

  • dtype – The data type of provided data. If dtype does not match, data will be converted. Note: disables sharing of the memory when convertion occurs.

  • name – Optional name for output node.

  • shared_memory – keyword-only argument. If True, this Constant’s memory is being shared with a host, that means the responsibility of keeping host memory is on the side of a user. Any action performed on the host memory is reflected on this Constant’s memory! If False, data is being copied to this Constant. Requires data to be C_CONTIGUOUS if True. Disabled by default if: - value is a scalar. - dtype is one of: Type.u1, Type.i4, Type.u4, Type.nf4, Type.bf16. - dtype force conversion of data.

Returns

The Constant node initialized with provided data.