constant¶
dragon.vm.tensorflow.
constant
(
value,
dtype=None,
shape=None,
name='Const'
)[source]¶Return a tensor initialized from the value.
Examples:
a = tf.constant(1) b = tf.constant(1, dtype='float32', shape=[1, 1, 1]) c = tf.constant(numpy.ones((2, 3))
- Parameters:
- value (array_like) – The constant value.
- dtype (str, optional) – The optional data type.
- shape (Sequence[int], optional) – The optional tensor shape.
- name (str, optional) – The optional tensor name.
- Returns:
dragon.Tensor – The output tensor.