pub struct ReplayBurnTensors<B: Backend> {
pub observations: Tensor<B, 2>,
pub actions: Tensor<B, 1, Int>,
pub rewards: Tensor<B, 1>,
pub next_observations: Tensor<B, 2>,
pub dones: Tensor<B, 1>,
}Expand description
Bundle of Burn tensors produced by ReplayBatch::to_burn_tensors.
Fields are in the order DQN trainers consume them: state and action first, then the reward signal, then the bootstrap state and terminal mask used to build the TD target. Fields are named so downstream patches that add fields stay source-compatible.
Fields§
§observations: Tensor<B, 2>Observations, shape [batch, obs_dim], dtype f32.
actions: Tensor<B, 1, Int>Discrete actions, shape [batch], dtype i64.
rewards: Tensor<B, 1>Rewards, shape [batch], dtype f32.
next_observations: Tensor<B, 2>Bootstrap-state observations, shape [batch, obs_dim], dtype f32.
dones: Tensor<B, 1>Episode-terminal mask (0.0 or 1.0), shape [batch], dtype f32.
Kept as f32 so the TD-target formula (1 - done) works directly.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for ReplayBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: Freeze,
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for ReplayBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for ReplayBurnTensors<B>
impl<B> Sync for ReplayBurnTensors<B>
impl<B> Unpin for ReplayBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: Unpin,
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for ReplayBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for ReplayBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: UnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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