17 for(
size_t i(0lu); i < nbDim; ++i){
18 fullSize *= tabDim[i];
29 if(destTabDim != NULL){
33 if(nbDim == 0lu || tabDim == NULL){
37 destTabDim =
new size_t[nbDim];
38 memcpy(destTabDim, tabDim, nbDim*
sizeof(
size_t));
47void phoenix_copyShape(
size_t *& destTabDim,
size_t & destNbDim,
const size_t * tabDim,
size_t nbDim){
59bool phoenix_isSameShape(
const size_t * tabDim1,
size_t nbDim1,
const size_t * tabDim2,
size_t nbDim2){
60 if(tabDim1 == NULL && tabDim2 == NULL){
return true;}
61 if(nbDim1 != nbDim2 || tabDim1 == NULL || tabDim2 == NULL){
return false;}
62 bool isSameSize(
true);
64 while(isSameSize && i < nbDim1){
65 isSameSize = tabDim1[i] == tabDim2[i];
void phoenix_copyShape(size_t *&destTabDim, const size_t *tabDim, size_t nbDim)
Copy a shape of a tensor into an other.
size_t phoenix_getFullSize(const size_t *tabDim, size_t nbDim)
Get the fulle size of the tensor.
bool phoenix_isSameShape(const size_t *tabDim1, size_t nbDim1, const size_t *tabDim2, size_t nbDim2)
Say if two shapes are the same or not.