3#include <ATen/core/IListRef.h>
5#include <c10/core/DeviceGuard.h>
6#include <c10/core/ScalarType.h>
27 return t.has_value() ?
device_of(
t.value()) : nullopt;
bool defined() const
Definition: TensorBase.h:198
Device device() const
Returns a Tensor's device.
Definition: TensorBase.h:387
Definition: TensorBody.h:90
Definition: Optional.h:549
Definition: TensorBase.h:34
c10::optional< Device > device_of(const Tensor &t)
Return the Device of a Tensor, if the Tensor is defined.
Definition: DeviceGuard.h:18
at::Tensor t(const at::Tensor &self)
Definition: Functions.h:7681
constexpr nullopt_t nullopt
Definition: Optional.h:163
constexpr optional< typename std::decay< T >::type > make_optional(T &&v)
Definition: Optional.h:1223