style: apply rustfmt across all crates and demos
Consistent formatting pass: line wrapping, import sorting, trailing whitespace removal, let-chain indentation, merged derive attributes, and unsafe block reformatting. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -67,7 +67,7 @@ pub struct TimeSeriesForecaster {
|
||||
|
||||
impl TimeSeriesForecaster {
|
||||
/// Create a new forecaster
|
||||
#[must_use]
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
let device = select_device(true);
|
||||
Self {
|
||||
@@ -326,10 +326,7 @@ impl TimeSeriesForecaster {
|
||||
.clone();
|
||||
|
||||
// Get the last timestamp from training data
|
||||
let last_timestamp = training_data
|
||||
.data
|
||||
.last()
|
||||
.map_or(0.0, |p| p.timestamp);
|
||||
let last_timestamp = training_data.data.last().map_or(0.0, |p| p.timestamp);
|
||||
|
||||
// Convert tensors to DataPoints
|
||||
let mean_vec = output.mean.to_vec()?;
|
||||
@@ -424,9 +421,10 @@ impl Default for TimeSeriesForecaster {
|
||||
fn select_device(use_gpu: bool) -> Device {
|
||||
if use_gpu
|
||||
&& let Ok(device) = Device::try_default()
|
||||
&& device.is_gpu() {
|
||||
return device;
|
||||
}
|
||||
&& device.is_gpu()
|
||||
{
|
||||
return device;
|
||||
}
|
||||
Device::cpu()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user