GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing tensor-array.github.io — TensorArray: Tensor-Array
Tensor-Array A C++ Tensor library that can be used to work with machine learning or deep learning project. Build your own neural network models with this library. Installing <tt>Tensor-Array</tt>You need to clone repository by using Git You need to install git clone https://github.com/Tensor-Array/Tensor-Array.git
cd Tensor-Array
mkdir build
cd build
cmake ..
cmake --build .
cmake --install .
cd ..
Why this repository named <tt>Tensor-Array</tt>We created a template struct that named {C++}
#include <tensor-array/core/tensorbase.hh>
using namespace tensor_array::value;
int main()
{
TensorArray<float, 4, 4> example_tensor_array =
{{
{{ 1, 2, 3, 4 }},
{{ 5, 6, 7, 8 }},
{{ 9, 10, 11, 12 }},
{{ 13, 14, 15, 16 }},
}};
return 0;
}
That code is wrapping for: {C++}
int main()
{
float example_tensor_array[4][4] =
{
{ 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12 },
{ 13, 14, 15, 16 },
};
return 0;
}
The <tt>Tensor</tt> class.The The The {C++}
#include <iostream>
#include <tensor-array/core/tensor.hh>
using namespace std;
using namespace tensor_array::value;
int main()
{
TensorArray<float, 4, 4> example_tensor_array =
{{
{{ 1, 2, 3, 4 }},
{{ 5, 6, 7, 8 }},
{{ 9, 10, 11, 12 }},
{{ 13, 14, 15, 16 }},
}};
TensorArray<float> example_tensor_array_scalar = {100};
Tensor example_tensor_1(example_tensor_array);
Tensor example_tensor_2(example_tensor_array_scalar);
Tensor example_tensor_sum = example_tensor_1 + example_tensor_2;
cout << example_tensor_sum << endl;
example_tensor_sum.calc_grad();
cout << example_tensor_1.get_grad() << endl;
cout << example_tensor_2.get_grad() << endl;
return 0;
}
Generated by | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |