Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 720 Bytes

README.md

File metadata and controls

48 lines (34 loc) · 720 Bytes

Aqua

This is a C++ library providing tensor variables and calculation of tensor, which can be used to implement neural networks

Usage

Import

#include <Tensor.hpp>

Declaration

// Aqua::Tensor t<variable_type, num_of_dimension>;
Aqua::Tensor t<double, 2>;

Assignment

Aqua::Tensor t<double, 2> t = {
    {1, 2, 3},
    {4, 5, 6}
};

Operations

Outputting

Tensor<int, 3> t = {{{1, 2, 3}, {4, 5, 6}}, {{1, 2, 3}, {4, 5, 6}}};
t.disp();

// Outputs:
// [[[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]]

Element Accessing

Tensor<int, 3> t = {{{1, 2, 3}, {4, 5, 6}}, {{1, 2, 3}, {4, 5, 6}}};
cout << t.at(0, 1, 2);

// Outputs:
// 6