Struct LazyHistoryFeatures

Source
pub struct LazyHistoryFeatures<'a, OS: Space + ?Sized, AS: Space + ?Sized, E> { /* private fields */ }
Expand description

Packed history features with lazy evaluation and caching.

Implementations§

Source§

impl<'a, OS, AS, E> LazyHistoryFeatures<'a, OS, AS, E>
where OS: Space + ?Sized, AS: Space + ?Sized, E: Sequence,

Source

pub fn new<I>( episodes: I, observation_space: &'a OS, action_space: &'a AS, device: Device, ) -> Self
where I: IntoIterator<Item = E>,

Source

pub fn num_steps(&self) -> usize

Source

pub fn num_episodes(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<'a, OS: Debug + Space + ?Sized, AS: Debug + Space + ?Sized, E: Debug> Debug for LazyHistoryFeatures<'a, OS, AS, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, OS, AS, E> HistoryFeatures for LazyHistoryFeatures<'a, OS, AS, E>
where OS: FeatureSpace + ?Sized, AS: ReprSpace<Tensor> + ?Sized, E: Sequence<Item = &'a PartialStep<OS::Element, AS::Element>> + IntoIterator<Item = &'a PartialStep<OS::Element, AS::Element>> + Copy, E::IntoIter: DoubleEndedIterator,

Source§

fn observation_features(&self) -> &PackedTensor

Packed observation features. A 2D f32 tensor.
Source§

fn extended_observation_features(&self) -> (&PackedTensor, &PackedTensor)

Packed extended observation features. Includes interrupted successor observations. Read more
Source§

fn actions(&self) -> &PackedTensor

Packed action values. Read more
Source§

fn rewards(&self) -> &PackedTensor

Packed rewards. A 1D f32 tensor.
Source§

fn device(&self) -> Device

Device on which tensors will be placed.

Auto Trait Implementations§

§

impl<'a, OS, AS, E> !Freeze for LazyHistoryFeatures<'a, OS, AS, E>

§

impl<'a, OS, AS, E> RefUnwindSafe for LazyHistoryFeatures<'a, OS, AS, E>

§

impl<'a, OS, AS, E> !Send for LazyHistoryFeatures<'a, OS, AS, E>

§

impl<'a, OS, AS, E> !Sync for LazyHistoryFeatures<'a, OS, AS, E>

§

impl<'a, OS, AS, E> Unpin for LazyHistoryFeatures<'a, OS, AS, E>
where E: Unpin, OS: ?Sized, AS: ?Sized,

§

impl<'a, OS, AS, E> UnwindSafe for LazyHistoryFeatures<'a, OS, AS, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert into an Any trait reference.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Wrap for T

Source§

fn wrap<W>(self, wrapper: W) -> Wrapped<Self, W>

Wrap in the given wrapper.