//! Financial Time Series Transformer using Candle
//!
//! Real implementation based on Candle framework for HFT prediction

use ml_core::native_types::NativeDevice;
use ml_core::native_types::{NativeDevice, NativeDType, NativeTensor};
use ml_core::cuda_autograd::GpuTensor;
use ml_core::cuda_autograd::{GpuAdamW, AdamWConfig};
use ml_core::cuda_autograd::{GpuLinear, GpuVarStore};
use serde::{Deserialize, Serialize};

use crate::{MLAppResult, TrainingMetrics};
use super::*;
use tracing::debug;


    #[tokio::test]
    async fn test_financial_transformer_creation() {
        let device = NativeDevice::Cuda(0);
        let config = FinancialTransformerConfig::default();

        // Note: This is a basic test structure
        // In a real implementation, we would create proper GpuVarStoreBuilder and test forward pass
        debug!(?config, "Financial transformer config");
        assert_eq!(config.d_model, 256);
        assert_eq!(config.num_heads, 8);
    }

    #[tokio::test]
    async fn test_transformer_forward_pass() {
        let device = NativeDevice::Cuda(0);
        let config = FinancialTransformerConfig {
            seq_len: 32,
            input_dim: 8,
            d_model: 64,
            num_heads: 4,
            num_layers: 2,
            d_ff: 256,
            ..Default::default()
        };

        // Create dummy input tensor
        let batch_size = 2;
        let input = GpuTensor::zeros(
            0_f32,
            1.0,
            (batch_size, config.seq_len, config.input_dim),
            &device,
        )
        .map_err(|e| anyhow!("Failed to create input tensor: {:?}", e))?;

        debug!(shape = ?input.shape(), "Input tensor shape");
        assert_eq!(
            input.dims3()?,
            (batch_size, config.seq_len, config.input_dim)
        );
    }
}
