pub enum RValue {
Show 14 variants
Tensor(TensorCell),
TensorList(Vec<TensorCell>),
Int(i64),
IntList(Vec<i64>),
Double(f64),
Bool(bool),
String(String),
Device(Device),
Layout(Layout),
ScalarType(ScalarType),
MemoryFormat(MemoryFormat),
None,
PyObject(PickledPyObject),
Opaque(AliasTrackingRefCell<OpaqueIValue>),
}
Expand description
A pure Rust equivalent for IValue
. This is safe to treat like a normal
Rust value.
Variants§
Tensor(TensorCell)
TensorList(Vec<TensorCell>)
Int(i64)
IntList(Vec<i64>)
Double(f64)
Bool(bool)
String(String)
Device(Device)
Layout(Layout)
ScalarType(ScalarType)
MemoryFormat(MemoryFormat)
None
PyObject(PickledPyObject)
Opaque(AliasTrackingRefCell<OpaqueIValue>)
This is meant to be a catch-all for types that we don’t support natively in Rust.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RValue
impl<'de> Deserialize<'de> for RValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<MemoryFormat> for RValue
impl From<MemoryFormat> for RValue
Source§fn from(value: MemoryFormat) -> Self
fn from(value: MemoryFormat) -> Self
Converts to this type from the input type.
Source§impl From<PickledPyObject> for RValue
impl From<PickledPyObject> for RValue
Source§fn from(value: PickledPyObject) -> Self
fn from(value: PickledPyObject) -> Self
Converts to this type from the input type.
Source§impl From<ScalarType> for RValue
impl From<ScalarType> for RValue
Source§fn from(value: ScalarType) -> Self
fn from(value: ScalarType) -> Self
Converts to this type from the input type.
Source§impl From<Vec<AliasTrackingRefCell<Tensor>>> for RValue
impl From<Vec<AliasTrackingRefCell<Tensor>>> for RValue
Source§fn from(value: Vec<TensorCell>) -> Self
fn from(value: Vec<TensorCell>) -> Self
Converts to this type from the input type.
Source§impl FromPyObject<'_> for RValue
impl FromPyObject<'_> for RValue
Source§fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
Source§impl<'py> IntoPyObject<'py> for RValue
impl<'py> IntoPyObject<'py> for RValue
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime TensorCell
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime TensorCell
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Device
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Device
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Layout
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Layout
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime MemoryFormat
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime MemoryFormat
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime PickledPyObject
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime PickledPyObject
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime ScalarType
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime ScalarType
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime String
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime String
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Vec<TensorCell>
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Vec<TensorCell>
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Vec<i64>
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime Vec<i64>
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime bool
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime bool
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime f64
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime f64
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime i64
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime i64
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut TensorCell
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut TensorCell
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Device
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Device
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Layout
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Layout
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut MemoryFormat
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut MemoryFormat
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut PickledPyObject
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut PickledPyObject
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut ScalarType
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut ScalarType
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut String
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut String
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Vec<TensorCell>
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Vec<TensorCell>
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Vec<i64>
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut Vec<i64>
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut bool
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut bool
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut f64
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut f64
Source§impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut i64
impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut i64
Source§impl TryFrom<RValue> for TensorCell
impl TryFrom<RValue> for TensorCell
Source§impl TryFrom<RValue> for MemoryFormat
impl TryFrom<RValue> for MemoryFormat
Source§impl TryFrom<RValue> for PickledPyObject
impl TryFrom<RValue> for PickledPyObject
Source§impl TryFrom<RValue> for ScalarType
impl TryFrom<RValue> for ScalarType
Source§impl<'py> TryIntoPyObjectUnsafe<'py, PyAny> for &RValue
Convert into a PyObject
.
impl<'py> TryIntoPyObjectUnsafe<'py, PyAny> for &RValue
Convert into a PyObject
.
unsafe fn try_to_object_unsafe( self, py: Python<'py>, ) -> PyResult<Bound<'py, PyAny>>
Auto Trait Implementations§
impl !Freeze for RValue
impl !RefUnwindSafe for RValue
impl Send for RValue
impl Sync for RValue
impl Unpin for RValue
impl !UnwindSafe for RValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self
into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
Converts
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self
into a Python object. Read more