pub trait StreamCast<D: Scalar> {
type CastOutput<D2: Scalar, OutPacket: M>
where D: Cast<D2>;
// Required method
fn cast<D2: Scalar, OutPacket: M>(self) -> Self::CastOutput<D2, OutPacket>
where D: Cast<D2>;
}Expand description
Trait for stream tensors that can be cast to a different scalar type.
FIXME: This trait exists purely to disambiguate tensor cast() from scalar
Cast::cast() for rust-analyzer.
Required Associated Types§
Sourcetype CastOutput<D2: Scalar, OutPacket: M>
where
D: Cast<D2>
type CastOutput<D2: Scalar, OutPacket: M> where D: Cast<D2>
The output tensor type after casting to scalar type D2.
Required Methods§
Sourcefn cast<D2: Scalar, OutPacket: M>(self) -> Self::CastOutput<D2, OutPacket>where
D: Cast<D2>,
fn cast<D2: Scalar, OutPacket: M>(self) -> Self::CastOutput<D2, OutPacket>where
D: Cast<D2>,
Casts this tensor’s scalar type from D to D2.
The cast engine operates on a single 32-byte flit. The input packet must already be exactly 32 bytes (ensured by the Collect Engine). After casting, the output packet is padded back to 32 bytes. Time passes through unchanged.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.