Dragon API Dragon v0.3.0 Python Constant¶ class dragon.vm.tensorflow.keras.initializers.Constant( value=0, dtype='float32')[source]¶ Fill tensor with a scalar value. \[\text{tensor} \leftarrow \text{value} \] __init__¶ Constant.__init__( value=0, dtype='float32')[source]¶ Create a Constant initializer. Parameters: value (number, optional, default=0) – The scalar value to fill. dtype (str, optional, default='float32') – The data type to set as default. Methods¶ __call__¶ Constant.__call__( shape, dtype=None, **kwargs)[source]¶ Return a tensor initialized from the initializer. Parameters: shape (Sequence[int]) – The tensor shape. dtype (str, optional) – The optional data type. Returns:dragon.Tensor – The output tensor.