Skip to content

This repo demonstrates how can be implemented a small-sized multidimensional array that supports fast reshaping and subarray extraction.

License

Notifications You must be signed in to change notification settings

TimurIskahov/TensorExercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorExercise

This repo demonstrates how can be implemented a multidimensional array. The idea is to keep a multidimensional array as a one-dimensional sequential array and operate with dimensions.

A multidimensional array can be initialized as

Tensor<float> t1({ 10, 50, 100});

It is mean that t1 has three dimensions with 10x50x100.

There are two operations:

  1. reshaping
Tensor<float> t2 = t1.reshape({ 500 , 100 });
  1. extracting subarray
Tensor<float> t3 = t1(3, 4);

The Tensor contains a shared pointer inside the class. If a subarray modifies, an original array will be modified too.

About

This repo demonstrates how can be implemented a small-sized multidimensional array that supports fast reshaping and subarray extraction.

Topics

Resources

License

Stars

Watchers

Forks

Languages