blob: ddf95a060b2536fc2104a0f309d20c9d8564f4c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#pragma once
#include "schema.hpp"
namespace saw {
namespace schema {
/**
* Tensor Schema. I think I need this due to the amount of mathematical operators being able to be represented by this one construct.
*/
template<typename Inner, uint64_t... D>
struct Tensor {
static constexpr uint64_t Rank = sizeof...(D);
static constexpr std::array<uint64_t,Rank> Dimension{D...};
static constexpr string_literal name = "Tensor";
};
template<typename Inner>
using Scalar = Tensor<Inner>;
template<typename Inner, uint64_t D>
using Vector = Tensor<Inner,D>;
template<typename Inner, uint64_t D1, uint64_t D2>
using Matrix = Tensor<Inner,D1,D2>;
}
}
|