Last active
August 18, 2017 07:57
-
-
Save marty1885/fba41a4f2b58fc25f6b4524b5d741e41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <xtensor/xarray.hpp> | |
#include <xtensor/xrandom.hpp> | |
#include <xtensor/xio.hpp> | |
#include <xtensor/xindexview.hpp> | |
#include <xtensor-blas/xlinalg.hpp> | |
#include <iostream> | |
using namespace std; | |
void s1() | |
{ | |
cout << "\nscenario 1. ==========" << endl; | |
xt::xarray<float> x = {{0,1,1,1}}; | |
x = xt::transpose(x); | |
cout << x << endl; | |
} | |
void s2() | |
{ | |
cout << "\nscenario 2. ==========" << endl; | |
xt::xarray<float> tmp = {{0,1,1,1}}; | |
xt::xarray<float> x = xt::transpose(tmp); | |
cout << x << endl; | |
} | |
void s3() | |
{ | |
cout << "\nscenario 3. ==========" << endl; | |
xt::xarray<float> tmp = {{0,1,1,1}}; | |
auto x = xt::transpose(tmp); | |
cout << x << endl; | |
} | |
void s4() | |
{ | |
cout << "\nscenario 4. ==========" << endl; | |
auto x = xt::transpose(xt::xarray<float>({{0,1,1,1}})); | |
cout << x << endl; | |
} | |
void s5() | |
{ | |
cout << "\nscenario 5. ==========" << endl; | |
auto x = xt::xarray<float>({{0,1,1,1}}); | |
x = xt::transpose(x); | |
cout << x << endl; | |
} | |
int main() | |
{ | |
s1(); | |
s2(); | |
s3(); | |
s4(); | |
s5(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This program prints the following on my system.