teeny_core/nn/activation/
tanh.rs1use core::marker::PhantomData;
18
19use crate::{
20 dtype::{EagerTensor, Float, Tensor},
21 nn::Layer,
22};
23
24pub struct Tanh<D: Float, T, const RANK: usize> {
26 _pd: PhantomData<(D, T)>,
27}
28
29impl<D: Float, T, const RANK: usize> Tanh<D, T, RANK> {
30 pub fn new() -> Self {
32 Self { _pd: PhantomData }
33 }
34}
35
36impl<D: Float, T, const RANK: usize> Default for Tanh<D, T, RANK> {
37 fn default() -> Self {
38 Self::new()
39 }
40}
41
42impl<D: Float, T: Tensor<D, RANK> + EagerTensor, const RANK: usize> Layer<T> for Tanh<D, T, RANK> {
43 type Output = T;
44 fn call(&self, _input: T) -> Self::Output {
45 todo!()
46 }
47}
48
49pub struct Tanhshrink<D: Float, T, const RANK: usize> {
51 _pd: PhantomData<(D, T)>,
52}
53
54impl<D: Float, T, const RANK: usize> Tanhshrink<D, T, RANK> {
55 pub fn new() -> Self {
57 Self { _pd: PhantomData }
58 }
59}
60
61impl<D: Float, T, const RANK: usize> Default for Tanhshrink<D, T, RANK> {
62 fn default() -> Self {
63 Self::new()
64 }
65}
66
67impl<D: Float, T: Tensor<D, RANK> + EagerTensor, const RANK: usize> Layer<T>
68 for Tanhshrink<D, T, RANK>
69{
70 type Output = T;
71 fn call(&self, _input: T) -> Self::Output {
72 todo!()
73 }
74}