Coerce objects to tensorflow tensors (potentially of a specific dtype). The
provided default methods will call
tf.convert_to_tensor
and tf.cast as
appropriate.
Usage
as_tensor(x, dtype = NULL, ..., name = NULL)
# S3 method for default
as_tensor(x, dtype = NULL, ..., name = NULL)
# S3 method for double
as_tensor(x, dtype = NULL, ..., name = NULL)
Arguments
x
object to convert
dtype
NULL, a tensorflow dtype (tf$int32), or something coercible
to one (e.g. a string "int32")
...,
ignored
name
NULL or a string. Useful for debugging in graph mode, ignored
while in eager mode.