convert_to_tensor

dragon.vm.tensorflow.convert_to_tensor(
  value,
  dtype=None,
  name=None
)[source]

Convert the given value to a tensor.

Examples:

x = tf.convert_to_tensor([1, 2])
y = tf.constant([1, 2])  # Equivalent
Parameters:
  • value (Union[number, Sequence, numpy.ndarray]) – The value to convert.
  • dtype (str, optional) – The optional data type.
  • name (str, optional) – The Optional name.
Returns:

dragon.Tensor – The output tensor.

See also

tf.constant(…)