HubertKrawczyk commented on PR #2265:
URL: https://github.com/apache/systemds/pull/2265#issuecomment-3029392618

   > > ```
   > > ERROR: R has ended irregularly
   > > R Standard output :
   > > 
   > > R Standard Error  :
   > > Error in library("einsum") : there is no package called ‘einsum’
   > > Execution halted
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > @Baunsgaard Would it be possible to install the R einsum package on the 
build server?
   > 
   > yes, but preferably no. Is the operation you want to import easy to write 
in R linear algebra?
   
   For some easy operations such as matrix multiplications - yes, for more 
complex chains it can be hard to write, unreadable and easy to do mistakes. And 
finally there can be some special ones that cannot be solved using 2D matrix 
operations e.g. 'fx,fg,fz,xg,zx,zg->g' (test 11) (the first intermediate would 
be 3 dimensional matrix) so the only option would be 4 for loops:
   
   ```
   for (g in 1:G) {
     sum_val <- 0
     for (f in 1:F) {
       for (x in 1:X) {
         for (z in 1:Z) {
           sum_val <- sum_val +
             fx[f, x] *
             fg[f, g] *
             fz[f, z] *
             xg[x, g] *
             zx[z, x] *
             zg[z, g]
         }
       }
     }
     out[g] <- sum_val
   }
   ```
   
   so if we don't want the package then this can be solution, but I think it 
would be just more readable with a simple einsum call 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to