torsh_graph/parameter.rs
1//! Minimal Parameter implementation for torsh-graph
2//! This is a temporary replacement for torsh_nn::Parameter to avoid compilation issues
3
4use torsh_tensor::Tensor;
5
6/// Minimal Parameter wrapper for torsh-graph
7#[derive(Clone, Debug)]
8pub struct Parameter {
9 tensor: Tensor,
10}
11
12impl Parameter {
13 /// Create a new parameter
14 pub fn new(tensor: Tensor) -> Self {
15 Self { tensor }
16 }
17
18 /// Get the underlying tensor data (clone)
19 pub fn clone_data(&self) -> Tensor {
20 self.tensor.clone()
21 }
22
23 /// Get a reference to the tensor
24 pub fn tensor(&self) -> &Tensor {
25 &self.tensor
26 }
27}