asc-community / asc-community/GenericTensor
[WIP] GenericTensor 2.0 API Design
- Dominant language
- C#
- Stars
- 52
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
# Name of the type
For now we will assume it's `Tensor`. However it's opionated, because it might be useful to avoid calling it the same name as other libs.
# Operations
Namespace: `GenericTensor.Core`.
Interfaces with method `Invoke: () -> A`
```
IAdditiveIdentity
IMultiplicativeIdentity
```
Interfaces with method `Invoke: A -> B`
```
INegate
```
Interfaces with method `Invoke: A x B -> C`
```
IAdd
ISubtract
IMultiply
IDivide
```
Interfaces with method `Invoke: A -> bool`
```
IEqualsAdditiveIdentity
```
Interfaces with method `Invoke: A x B -> bool`
```
IAreEqual
```
Interfaces with method `Invoke: A -> string`
```
IToString
```
Interfaces with method `Invoke: A -> byte[]`
```
ISerialize
```
Interfaces with method `Invoke: byte[] -> A`
```
IDeserialize
```
# Tensor
The main type where all these methods will be is `Tensor` (but not `Tensor`!).
## Composition
```cs
static Tensor Concat(params Tensor[] ts, int axis = -1);
byte[] Serialize() where TSerializer : ISerialize;
Tensor Slice(params Either[] dims);
static Tensor Stack(params Tensor[] ts);
Tensor Transpose(Tensor a);
Tensor Transpose(Tensor a, int axis1, int axis2);
void TransposeInplace(Tensor a);
void TransposeInplace(Tensor a, int axis1, int axis2);
```
## Math operations
...
### Elementwise:
```
void AddPointwise(Tensor a, Tensor b, Tensor destination) where TAdder : struct, IAdder;
Tensor AddPointwise(Tensor a, Tensor b) where TAdder : struct, IAdder;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.