public static VTensor combine ( VTensor t1 , VTensor t2 ) { checkSameDims ( t1 , t2 ) ; checkSameAlgebra ( t1 , t2 ) ; int [ ] dims3 = IntArrays . insertEntry ( t1 . getDims ( ) , 0 , 2 ) ; VTensor y = new VTensor ( t1 . s , dims3 ) ; y . addTensor ( t1 , 0 , 0 ) ; y . addTensor ( t2 , 0 , 1 ) ; return y ; }
Combines two identically sized tensors by adding an initial dimension of size 2 .