![eye eye]()
Here's few runtime tests comparing this bsxfun based approach against repmat + eye based approach for big datasizes -***** Datasize: 500 x 500 x 500 *****----------------------- With BSXFUNElapsed time is 0.008383 seconds.----------------------- With REPMAT + EYEElapsed time is 0.163341 seconds.***** Datasize: 800 x 800 x 500 *****----------------------- With BSXFUNElapsed time is 0.012977 seconds.----------------------- With REPMAT + EYEElapsed time is 0.402111 seconds.***** Datasize: 1000 x 1000 x 500 *****----------------------- With BSXFUNElapsed time is 0.017058 seconds.----------------------- With REPMAT + EYEElapsed time is 0.690199 seconds. 这篇关于从张量的每个额叶切片中提取对角线元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-01 07:43