# ! [ f e a t u r e ( p r e l u d e _ i m p o r t ) ] 
 
 / / !   T y p e s   f o r   h a n d l i n g   a r r a y s   w i t h   m u l t i p l e   i n d e x e s . 
 
 / / ! 
 
 / / !   P r o v i d e s   t y p e s   f o r   a r r a y s   w i t h   m u l t i p l e   i n d e x e s   ( u p   t o   8   i n d e x e s )   t h a t   a r e : 
 
 / / !   -   c o n v e n i e n t   t o   m a n i p u l a t e   t h a n k s   t o   [ a s s o c i a t e d   m a c r o s ] ( h t t p s : / / d o c s . r s / t e n s o r i s m - g e n / l a t e s t / t e n s o r i s m - g e n / ) ; 
 
 / / !   -   s a f e   t o   u s e   a s   d i m e n s i o n s   a r e   e n c o d e d   i n   t h e   t y p e   s y s t e m ; 
 
 / / !   -   m i n i m i s i n g   t h e   n u m b e r   o f   r u n t i m e   c h e c k s   a b o u t   v a l i d i t y   o f   i n d e x e s . 
 
 / / ! 
 
 / / !   #   T e n s o r   t y p e s   a n d   d i m e n s i o n s 
 
 / / ! 
 
 / / !   T e n s o r   t y p e s   ( [ T e n s o r 0 ] ( t e n s o r s : : T e n s o r 0 ) ,   [ T e n s o r 1 ] ( t e n s o r s : : T e n s o r 1 ) ,   [ T e n s o r 2 ] ( t e n s o r s : : T e n s o r 2 ) , 
 
 / / !   [ T e n s o r 3 ] ( t e n s o r s : : T e n s o r 3 ) ,   [ T e n s o r 4 ] ( t e n s o r s : : T e n s o r 4 ) ,   [ T e n s o r 5 ] ( t e n s o r s : : T e n s o r 5 ) ,   [ T e n s o r 6 ] ( t e n s o r s : : T e n s o r 6 ) , 
 
 / / !   [ T e n s o r 7 ] ( t e n s o r s : : T e n s o r 7 )   a n d   [ T e n s o r 8 ] ( t e n s o r s : : T e n s o r 8 ) )   a r e   g e n e r i c   t y p e s   n o t   o n l y   o v e r   t h e   t y p e   o f   d a t a   t h e y 
 
 / / !   c o n t a i n s   b u t   a l s o   o v e r   t h e i r   m u l t i p l e   d i m e n s i o n s .   T h i s   m e a n s   d i m e n s i o n s   a r e   e n c o d e d   i n   t h e   t y p e   s y s t e m . 
 
 / / !   ` ` ` 
 
 / / !   / /   A   t e n s o r   o f   u s i z e s   o f   r a n k   3   w i t h   s t a t i c   d i m e n s i o n s   3 ,   2   a n d   5 . 
 
 / / !   l e t   t e n s o r _ a :   T e n s o r 3 < S t a t i c D i m T a g < 3 > ,   S t a t i c D i m T a g < 2 > ,   S t a t i c D i m T a g < 5 > ,   u s i z e >   = 
 
 / / !       T e n s o r B u i l d i n g : : w i t h _ s t a t i c : : < 3 > ( ) 
 
 / / !           . w i t h _ s t a t i c : : < 2 > ( ) 
 
 / / !           . w i t h _ s t a t i c : : < 5 > ( ) 
 
 / / !           . d e f i n e ( | ( i ,   j ,   k ) |   ( 3   *   i   +   2   *   j   +   5   *   k )   %   1 7 ) ; 
 
 / / !   / /   A   t e n s o r   o f   s t r i n g s   o f   r a n k   1   w i t h   s t a t i c   d i m e n s i o n s   1 3 0 . 
 
 / / !   l e t   t e n s o r _ b :   T e n s o r 1 < S t a t i c D i m T a g < 1 3 0 > ,   S t r i n g >   = 
 
 / / !       T e n s o r B u i l d i n g : : w i t h _ s t a t i c : : < 1 3 0 > ( ) 
 
 / / !           . p r e p a r e ( ) 
 
 / / !           . a p p e n d _ v e c ( & m u t   s t r i n g _ v e c t o r ) 
 
 / / !           . g e n e r a t e ( ) ; 
 
 / / !   ` ` ` 
 
 / / !   T h i s   i s   n o t   o n l y   t r u e   f o r   c o m p i l e - t i m e   d i m e n s i o n s .   Y o u   c a n   a l s o   c r e a t e   t e n s o r s   s o m e   d i m e n s i o n s   o f   w h i c h 
 
 / / !   a r e   n o t   k n o w n   u n t i l   r u n t i m e   a n d   s t i l l   t e l l i n g   t h e   c o m p i l e r   w h e r e   t h e s e   d i m e n s i o n s   a r e   e q u a l ,   i n d e p e n d e n t l y 
 
 / / !   o f   t h e i r   a c t u a l   n u m e r i c a l   v a l u e . 
 
 / / !   ` ` ` 
 
 / / !   l e t   n :   u s i z e   =     ; 
 
 / / !   l e t   m :   u s i z e   =     ; 
 
 / / !   / /   A   t e n s o r   o f   f l o a t s   o f   r a n k   4   w i t h   d i m e n s i o n s   n ,   3 ,   m   a n d   n . 
 
 / / !   / /   I t s   t y p e   i s   s i m i l a r   t o   ` T e n s o r 4 < T a g N ,   S t a t i c D i m T a g < 3 > ,   T a g M ,   T a g N ,   f 6 4 > ` . 
 
 / / !   l e t   t e n s o r _ c :   T e n s o r 4 < _ ,   S t a t i c D i m T a g < 3 > ,   _ ,   _ ,   f 6 4 >   = 
 
 / / !       T e n s o r B u i l d i n g : : w i t h ( n e w _ d y n a m i c _ d i m ! ( n ) ) 
 
 / / !           . w i t h _ s t a t i c : : < 3 > ( ) 
 
 / / !           . w i t h ( n e w _ d y n a m i c _ d i m ! ( m ) ) 
 
 / / !           . w i t h _ f i r s t ( ) 
 
 / / !           . d e f i n e ( | ( i ,   j ,   k ,   l ) |       a s   f 6 4 ) ; 
 
 / / ! 
 
 / / !   / /   A   t e n s o r   o f   b o o l e a n s   o f   r a n k   2   w i t h   d i m e n s i o n s   m   a n d   n . 
 
 / / !   / /   I t s   t y p e   i s   s i m i l a r   t o   ` T e n s o r 4 < T a g M ,   T a g N ,   b o o l > ` . 
 
 / / !   l e t   t e n s o r _ d :   T e n s o r 2 < _ ,   _ ,   b o o l >   = 
 
 / / !       T e n s o r B u i l d i n g : : w i t h ( t e n s o r _ c . s h a p e ( ) . 2 ) 
 
 / / !           . w i t h ( t e n s o r _ c . s h a p e ( ) . 0 ) 
 
 / / !           . d e f i n e ( | ( i ,   j ) |       a s   b o o l ) ; 
 
 / / !   ` ` ` 
 
 / / ! 
 
 / / !   #   M a n i p u l a t i n g   t e n s o r s 
 
 / / ! 
 
 / / !   S i b l i n g   c r a t e   [ t e n s o r i s m - g e n ] ( h t t p s : / / d o c s . r s / t e n s o r i s m - g e n / l a t e s t / t e n s o r i s m - g e n / )   c o n t a i n s   p r o c e d u r a l 
 
 / / !   m a c r o s   t h a t   g r e a t l y   s i m p l i f y   t h e   e f f e c t i v e   m a n i p u l a t i o n   o f   t e n s o r s   v i a   a   d o m a i n   s p e c i f i c   l a n g u a g e .   P l e a s e 
 
 / / !   r e f e r   t o   t h i s   c r a t e   f o r   a d d i t i o n a l   d o c u m e n t a t i o n . 
 
 # ! [ c f g ( n o t ( d o c t e s t ) ) ] 
 
 # [ p r e l u d e _ i m p o r t ] 
 
 u s e   s t d : : p r e l u d e : : r u s t _ 2 0 2 1 : : * ; 
 
 # [ m a c r o _ u s e ] 
 
 e x t e r n   c r a t e   s t d ; 
 
 e x t e r n   c r a t e   l a z y _ s t a t i c ; 
 
 p u b   m o d   b u i l d i n g   { 
 
         u s e   c r a t e : : d i m e n s i o n s : : * ; 
 
         u s e   c r a t e : : t e n s o r s : : * ; 
 
         u s e   s t d : : f m t : : { D e b u g ,   E r r o r ,   F o r m a t t e r } ; 
 
         u s e   s t d : : m a r k e r : : { C o p y ,   P h a n t o m D a t a } ; 
 
         p u b   t r a i t   S h a p e   { 
 
                 / / /   T h e   n u m b e r   o f   d i m e n s i o n s ,   a l s o   c o r r e s p o n d i n g 
 
                 / / /   t o   t h e   n u m b e r   o f   i n d e x e s . 
 
                 c o n s t   R A N K :   u 1 6 ; 
 
                 / / /   T h e   t o t a l   n u m b e r   o f   c o o r d i n a t e s 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e ; 
 
         } 
 
         p u b   s t r u c t   T e n s o r 1 S h a p e < T :   D i m T a g >   { 
 
                 p u b ( c r a t e )   d :   D i m < T > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 1 S h a p e < T >   { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 1 S h a p e < T >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                 }   = >   T e n s o r 1 S h a p e   { 
 
                                         d :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 1 S h a p e < T >   { } 
 
         i m p l < T :   D i m T a g >   : : c o r e : : m a r k e r : : S t r u c t u r a l E q   f o r   T e n s o r 1 S h a p e < T >   { } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T :   : : c o r e : : c m p : : E q   +   D i m T a g >   : : c o r e : : c m p : : E q   f o r   T e n s o r 1 S h a p e < T >   { 
 
                 # [ i n l i n e ] 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 # [ n o _ c o v e r a g e ] 
 
                 f n   a s s e r t _ r e c e i v e r _ i s _ t o t a l _ e q ( & s e l f )   - >   ( )   { 
 
                         { 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < u s i z e > ; 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 2 S h a p e < T 1 :   D i m T a g ,   T 2 :   D i m T a g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g ,   T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g >   : : c o r e : : c l o n e : : C l o n e 
 
                 f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 2 S h a p e < T 1 ,   T 2 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                 }   = >   T e n s o r 2 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g ,   T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g >   : : c o r e : : m a r k e r : : C o p y 
 
                 f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 > 
 
         { 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g >   : : c o r e : : m a r k e r : : S t r u c t u r a l E q   f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 >   { } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T 1 :   : : c o r e : : c m p : : E q   +   D i m T a g ,   T 2 :   : : c o r e : : c m p : : E q   +   D i m T a g >   : : c o r e : : c m p : : E q 
 
                 f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 # [ n o _ c o v e r a g e ] 
 
                 f n   a s s e r t _ r e c e i v e r _ i s _ t o t a l _ e q ( & s e l f )   - >   ( )   { 
 
                         { 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 1 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 2 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < u s i z e > ; 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 3 S h a p e < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                 >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                 }   = >   T e n s o r 3 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         d 3 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 3 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                 >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 > 
 
         { 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g >   : : c o r e : : m a r k e r : : S t r u c t u r a l E q   f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 >   { } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                 >   : : c o r e : : c m p : : E q   f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 # [ n o _ c o v e r a g e ] 
 
                 f n   a s s e r t _ r e c e i v e r _ i s _ t o t a l _ e q ( & s e l f )   - >   ( )   { 
 
                         { 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 1 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 2 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 3 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < u s i z e > ; 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 4 S h a p e < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                 >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                 }   = >   T e n s o r 4 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         d 3 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                         d 4 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 3 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 4 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                 >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 > 
 
         { 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g >   : : c o r e : : m a r k e r : : S t r u c t u r a l E q 
 
                 f o r   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                 >   : : c o r e : : c m p : : E q   f o r   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 # [ n o _ c o v e r a g e ] 
 
                 f n   a s s e r t _ r e c e i v e r _ i s _ t o t a l _ e q ( & s e l f )   - >   ( )   { 
 
                         { 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 1 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 2 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 3 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 4 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < u s i z e > ; 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 5 S h a p e < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                 >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                 }   = >   T e n s o r 5 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         d 3 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                         d 4 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 3 ) ) , 
 
                                         d 5 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 4 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 5 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                 >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 > 
 
         { 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g >   : : c o r e : : m a r k e r : : S t r u c t u r a l E q 
 
                 f o r   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                 >   : : c o r e : : c m p : : E q   f o r   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 # [ n o _ c o v e r a g e ] 
 
                 f n   a s s e r t _ r e c e i v e r _ i s _ t o t a l _ e q ( & s e l f )   - >   ( )   { 
 
                         { 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 1 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 2 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 3 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 4 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 5 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < u s i z e > ; 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 6 S h a p e < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d 6 :   D i m < T 6 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                 >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                 }   = >   T e n s o r 6 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         d 3 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                         d 4 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 3 ) ) , 
 
                                         d 5 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 4 ) ) , 
 
                                         d 6 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 5 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 6 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                 >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g > 
 
                 : : c o r e : : m a r k e r : : S t r u c t u r a l E q   f o r   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c m p : : E q   +   D i m T a g , 
 
                 >   : : c o r e : : c m p : : E q   f o r   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 # [ n o _ c o v e r a g e ] 
 
                 f n   a s s e r t _ r e c e i v e r _ i s _ t o t a l _ e q ( & s e l f )   - >   ( )   { 
 
                         { 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 1 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 2 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 3 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 4 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 5 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < D i m < T 6 > > ; 
 
                                 l e t   _ :   : : c o r e : : c m p : : A s s e r t P a r a m I s E q < u s i z e > ; 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 7 S h a p e < 
 
                 T 1 :   D i m T a g , 
 
                 T 2 :   D i m T a g , 
 
                 T 3 :   D i m T a g , 
 
                 T 4 :   D i m T a g , 
 
                 T 5 :   D i m T a g , 
 
                 T 6 :   D i m T a g , 
 
                 T 7 :   D i m T a g , 
 
         >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d 6 :   D i m < T 6 > , 
 
                 p u b ( c r a t e )   d 7 :   D i m < T 7 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 7 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                 >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                         d 7 :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 7 , 
 
                                 }   = >   T e n s o r 7 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         d 3 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                         d 4 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 3 ) ) , 
 
                                         d 5 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 4 ) ) , 
 
                                         d 6 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 5 ) ) , 
 
                                         d 7 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 6 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 7 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 7 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                 >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 > 
 
         { 
 
         } 
 
         p u b   s t r u c t   T e n s o r 8 S h a p e < 
 
                 T 1 :   D i m T a g , 
 
                 T 2 :   D i m T a g , 
 
                 T 3 :   D i m T a g , 
 
                 T 4 :   D i m T a g , 
 
                 T 5 :   D i m T a g , 
 
                 T 6 :   D i m T a g , 
 
                 T 7 :   D i m T a g , 
 
                 T 8 :   D i m T a g , 
 
         >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d 6 :   D i m < T 6 > , 
 
                 p u b ( c r a t e )   d 7 :   D i m < T 7 > , 
 
                 p u b ( c r a t e )   d 8 :   D i m < T 8 > , 
 
                 s i z e :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 7 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                         T 8 :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g , 
 
                 >   : : c o r e : : c l o n e : : C l o n e   f o r   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                         d 7 :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                         d 8 :   r e f   _ _ s e l f _ 0 _ 7 , 
 
                                         s i z e :   r e f   _ _ s e l f _ 0 _ 8 , 
 
                                 }   = >   T e n s o r 8 S h a p e   { 
 
                                         d 1 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         d 2 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                         d 3 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 2 ) ) , 
 
                                         d 4 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 3 ) ) , 
 
                                         d 5 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 4 ) ) , 
 
                                         d 6 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 5 ) ) , 
 
                                         d 7 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 6 ) ) , 
 
                                         d 8 :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 7 ) ) , 
 
                                         s i z e :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 8 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 7 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                         T 8 :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g , 
 
                 >   : : c o r e : : m a r k e r : : C o p y   f o r   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 > 
 
         { 
 
         } 
 
         i m p l < T :   D i m T a g >   S h a p e   f o r   T e n s o r 1 S h a p e < T >   { 
 
                 c o n s t   R A N K :   u 1 6   =   1 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g >   S h a p e   f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 >   { 
 
                 c o n s t   R A N K :   u 1 6   =   2 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g >   S h a p e   f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 >   { 
 
                 c o n s t   R A N K :   u 1 6   =   3 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g >   S h a p e   f o r   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 >   { 
 
                 c o n s t   R A N K :   u 1 6   =   4 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g >   S h a p e 
 
                 f o r   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 > 
 
         { 
 
                 c o n s t   R A N K :   u 1 6   =   5 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g >   S h a p e 
 
                 f o r   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
                 c o n s t   R A N K :   u 1 6   =   6 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g ,   T 7 :   D i m T a g >   S h a p e 
 
                 f o r   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 > 
 
         { 
 
                 c o n s t   R A N K :   u 1 6   =   7 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                 >   S h a p e   f o r   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 > 
 
         { 
 
                 c o n s t   R A N K :   u 1 6   =   8 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . s i z e 
 
                 } 
 
         } 
 
         i m p l < L :   D i m T a g ,   R :   D i m T a g >   P a r t i a l E q < T e n s o r 1 S h a p e < R > >   f o r   T e n s o r 1 S h a p e < L >   { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 1 S h a p e < R > )   - >   b o o l   { 
 
                         s e l f . d   = =   o t h e r . d 
 
                 } 
 
         } 
 
         i m p l < L 1 :   D i m T a g ,   L 2 :   D i m T a g ,   R 1 :   D i m T a g ,   R 2 :   D i m T a g >   P a r t i a l E q < T e n s o r 2 S h a p e < R 1 ,   R 2 > > 
 
                 f o r   T e n s o r 2 S h a p e < L 1 ,   L 2 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 2 S h a p e < R 1 ,   R 2 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1   & &   s e l f . d 2   = =   o t h e r . d 2 
 
                 } 
 
         } 
 
         i m p l < L 1 :   D i m T a g ,   L 2 :   D i m T a g ,   L 3 :   D i m T a g ,   R 1 :   D i m T a g ,   R 2 :   D i m T a g ,   R 3 :   D i m T a g > 
 
                 P a r t i a l E q < T e n s o r 3 S h a p e < R 1 ,   R 2 ,   R 3 > >   f o r   T e n s o r 3 S h a p e < L 1 ,   L 2 ,   L 3 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 3 S h a p e < R 1 ,   R 2 ,   R 3 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1   & &   s e l f . d 2   = =   o t h e r . d 2   & &   s e l f . d 3   = =   o t h e r . d 3 
 
                 } 
 
         } 
 
         i m p l < 
 
                         L 1 :   D i m T a g , 
 
                         L 2 :   D i m T a g , 
 
                         L 3 :   D i m T a g , 
 
                         L 4 :   D i m T a g , 
 
                         R 1 :   D i m T a g , 
 
                         R 2 :   D i m T a g , 
 
                         R 3 :   D i m T a g , 
 
                         R 4 :   D i m T a g , 
 
                 >   P a r t i a l E q < T e n s o r 4 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 > >   f o r   T e n s o r 4 S h a p e < L 1 ,   L 2 ,   L 3 ,   L 4 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 4 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1   & &   s e l f . d 2   = =   o t h e r . d 2   & &   s e l f . d 3   = =   o t h e r . d 3   & &   s e l f . d 4   = =   o t h e r . d 4 
 
                 } 
 
         } 
 
         i m p l < 
 
                         L 1 :   D i m T a g , 
 
                         L 2 :   D i m T a g , 
 
                         L 3 :   D i m T a g , 
 
                         L 4 :   D i m T a g , 
 
                         L 5 :   D i m T a g , 
 
                         R 1 :   D i m T a g , 
 
                         R 2 :   D i m T a g , 
 
                         R 3 :   D i m T a g , 
 
                         R 4 :   D i m T a g , 
 
                         R 5 :   D i m T a g , 
 
                 >   P a r t i a l E q < T e n s o r 5 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 > >   f o r   T e n s o r 5 S h a p e < L 1 ,   L 2 ,   L 3 ,   L 4 ,   L 5 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 5 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1 
 
                                 & &   s e l f . d 2   = =   o t h e r . d 2 
 
                                 & &   s e l f . d 3   = =   o t h e r . d 3 
 
                                 & &   s e l f . d 4   = =   o t h e r . d 4 
 
                                 & &   s e l f . d 5   = =   o t h e r . d 5 
 
                 } 
 
         } 
 
         i m p l < 
 
                         L 1 :   D i m T a g , 
 
                         L 2 :   D i m T a g , 
 
                         L 3 :   D i m T a g , 
 
                         L 4 :   D i m T a g , 
 
                         L 5 :   D i m T a g , 
 
                         L 6 :   D i m T a g , 
 
                         R 1 :   D i m T a g , 
 
                         R 2 :   D i m T a g , 
 
                         R 3 :   D i m T a g , 
 
                         R 4 :   D i m T a g , 
 
                         R 5 :   D i m T a g , 
 
                         R 6 :   D i m T a g , 
 
                 >   P a r t i a l E q < T e n s o r 6 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 ,   R 6 > >   f o r   T e n s o r 6 S h a p e < L 1 ,   L 2 ,   L 3 ,   L 4 ,   L 5 ,   L 6 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 6 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 ,   R 6 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1 
 
                                 & &   s e l f . d 2   = =   o t h e r . d 2 
 
                                 & &   s e l f . d 3   = =   o t h e r . d 3 
 
                                 & &   s e l f . d 4   = =   o t h e r . d 4 
 
                                 & &   s e l f . d 5   = =   o t h e r . d 5 
 
                                 & &   s e l f . d 6   = =   o t h e r . d 6 
 
                 } 
 
         } 
 
         i m p l < 
 
                         L 1 :   D i m T a g , 
 
                         L 2 :   D i m T a g , 
 
                         L 3 :   D i m T a g , 
 
                         L 4 :   D i m T a g , 
 
                         L 5 :   D i m T a g , 
 
                         L 6 :   D i m T a g , 
 
                         L 7 :   D i m T a g , 
 
                         R 1 :   D i m T a g , 
 
                         R 2 :   D i m T a g , 
 
                         R 3 :   D i m T a g , 
 
                         R 4 :   D i m T a g , 
 
                         R 5 :   D i m T a g , 
 
                         R 6 :   D i m T a g , 
 
                         R 7 :   D i m T a g , 
 
                 >   P a r t i a l E q < T e n s o r 7 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 ,   R 6 ,   R 7 > > 
 
                 f o r   T e n s o r 7 S h a p e < L 1 ,   L 2 ,   L 3 ,   L 4 ,   L 5 ,   L 6 ,   L 7 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 7 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 ,   R 6 ,   R 7 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1 
 
                                 & &   s e l f . d 2   = =   o t h e r . d 2 
 
                                 & &   s e l f . d 3   = =   o t h e r . d 3 
 
                                 & &   s e l f . d 4   = =   o t h e r . d 4 
 
                                 & &   s e l f . d 5   = =   o t h e r . d 5 
 
                                 & &   s e l f . d 6   = =   o t h e r . d 6 
 
                                 & &   s e l f . d 7   = =   o t h e r . d 7 
 
                 } 
 
         } 
 
         i m p l < 
 
                         L 1 :   D i m T a g , 
 
                         L 2 :   D i m T a g , 
 
                         L 3 :   D i m T a g , 
 
                         L 4 :   D i m T a g , 
 
                         L 5 :   D i m T a g , 
 
                         L 6 :   D i m T a g , 
 
                         L 7 :   D i m T a g , 
 
                         L 8 :   D i m T a g , 
 
                         R 1 :   D i m T a g , 
 
                         R 2 :   D i m T a g , 
 
                         R 3 :   D i m T a g , 
 
                         R 4 :   D i m T a g , 
 
                         R 5 :   D i m T a g , 
 
                         R 6 :   D i m T a g , 
 
                         R 7 :   D i m T a g , 
 
                         R 8 :   D i m T a g , 
 
                 >   P a r t i a l E q < T e n s o r 8 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 ,   R 6 ,   R 7 ,   R 8 > > 
 
                 f o r   T e n s o r 8 S h a p e < L 1 ,   L 2 ,   L 3 ,   L 4 ,   L 5 ,   L 6 ,   L 7 ,   L 8 > 
 
         { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 8 S h a p e < R 1 ,   R 2 ,   R 3 ,   R 4 ,   R 5 ,   R 6 ,   R 7 ,   R 8 > )   - >   b o o l   { 
 
                         s e l f . d 1   = =   o t h e r . d 1 
 
                                 & &   s e l f . d 2   = =   o t h e r . d 2 
 
                                 & &   s e l f . d 3   = =   o t h e r . d 3 
 
                                 & &   s e l f . d 4   = =   o t h e r . d 4 
 
                                 & &   s e l f . d 5   = =   o t h e r . d 5 
 
                                 & &   s e l f . d 6   = =   o t h e r . d 6 
 
                                 & &   s e l f . d 7   = =   o t h e r . d 7 
 
                                 & &   s e l f . d 8   = =   o t h e r . d 8 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g >   D e b u g   f o r   T e n s o r 1 S h a p e < T >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g >   D e b u g   f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g >   D e b u g   f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g >   D e b u g   f o r   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g >   D e b u g 
 
                 f o r   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g >   D e b u g 
 
                 f o r   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 6 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g ,   T 7 :   D i m T a g >   D e b u g 
 
                 f o r   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 6 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 7 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                 >   D e b u g   f o r   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 6 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 7 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 8 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } " ) 
 
                 } 
 
         } 
 
         p u b   e n u m   T e n s o r B u i l d i n g   { } 
 
         i m p l   T e n s o r B u i l d i n g   { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( )   - >   T e n s o r 1 S h a p e < S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 1 S h a p e   { 
 
                                 d :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   N , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T :   D i m T a g > ( d i m e n s i o n :   D i m < T > )   - >   T e n s o r 1 S h a p e < T >   { 
 
                         T e n s o r 1 S h a p e   { 
 
                                 d :   d i m e n s i o n , 
 
                                 s i z e :   d i m e n s i o n . a s _ u s i z e ( ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   f r o m _ a r r a y _ t o _ t e n s o r 1 < V :   C o p y   +   P a r t i a l E q   +   D e b u g ,   c o n s t   N :   u s i z e > ( 
 
                         a r r a y :   & [ V ;   N ] , 
 
                 )   - >   T e n s o r 1 < S t a t i c D i m T a g < N > ,   V >   { 
 
                         T e n s o r 1 : : < S t a t i c D i m T a g < N > ,   V >   { 
 
                                 p h a n t o m :   P h a n t o m D a t a   { } , 
 
                                 d a t a :   a r r a y . t o _ v e c ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         # [ d o c ( h i d d e n ) ] 
 
         p u b   u n s a f e   f n   f r o m _ v e c _ t o _ t e n s o r 1 _ u n c h e c k e d < T :   D i m T a g ,   V :   C o p y   +   P a r t i a l E q   +   D e b u g > ( 
 
                 v a l u e s :   V e c < V > , 
 
         )   - >   T e n s o r 1 < T ,   V >   { 
 
                 T e n s o r 1 : : < T ,   V >   { 
 
                         p h a n t o m :   P h a n t o m D a t a   { } , 
 
                         d a t a :   v a l u e s , 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g >   T e n s o r 1 S h a p e < T >   { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( & s e l f )   - >   T e n s o r 2 S h a p e < T ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 2 S h a p e   { 
 
                                 d 1 :   s e l f . d , 
 
                                 d 2 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 2 :   D i m T a g > ( & s e l f ,   d i m e n s i o n :   D i m < T 2 > )   - >   T e n s o r 2 S h a p e < T ,   T 2 >   { 
 
                         T e n s o r 2 S h a p e   { 
 
                                 d 1 :   s e l f . d , 
 
                                 d 2 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 2 S h a p e < T ,   T >   { 
 
                         T e n s o r 2 S h a p e   { 
 
                                 d 1 :   s e l f . d , 
 
                                 d 2 :   s e l f . d , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . s i z e ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g >   T e n s o r 2 S h a p e < T 1 ,   T 2 >   { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( & s e l f )   - >   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 3 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 3 :   D i m T a g > ( & s e l f ,   d i m e n s i o n :   D i m < T 3 > )   - >   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 >   { 
 
                         T e n s o r 3 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 1 >   { 
 
                         T e n s o r 3 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e c o n d ( & s e l f )   - >   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 2 >   { 
 
                         T e n s o r 3 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 2 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 2 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 2 ( & s e l f )   - >   T e n s o r 2 S h a p e < T 2 ,   T 1 >   { 
 
                         T e n s o r 2 S h a p e   { 
 
                                 d 1 :   s e l f . d 2 , 
 
                                 d 2 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g >   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 >   { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( & s e l f )   - >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 4 :   D i m T a g > ( & s e l f ,   d i m e n s i o n :   D i m < T 4 > )   - >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 1 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e c o n d ( & s e l f )   - >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 2 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 2 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 2 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ t h i r d ( & s e l f )   - >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 3 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 3 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 2 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 2 ( & s e l f )   - >   T e n s o r 3 S h a p e < T 2 ,   T 1 ,   T 3 >   { 
 
                         T e n s o r 3 S h a p e   { 
 
                                 d 1 :   s e l f . d 2 , 
 
                                 d 2 :   s e l f . d 1 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 3 ( & s e l f )   - >   T e n s o r 3 S h a p e < T 3 ,   T 2 ,   T 1 >   { 
 
                         T e n s o r 3 S h a p e   { 
 
                                 d 1 :   s e l f . d 3 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g >   T e n s o r 4 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 >   { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( & s e l f )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 5 :   D i m T a g > ( & s e l f ,   d i m e n s i o n :   D i m < T 5 > )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 1 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e c o n d ( & s e l f )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 2 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 2 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ t h i r d ( & s e l f )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 3 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 3 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f o u r t h ( & s e l f )   - >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 4 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 4 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 2 ( & s e l f )   - >   T e n s o r 4 S h a p e < T 2 ,   T 1 ,   T 3 ,   T 4 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 2 , 
 
                                 d 2 :   s e l f . d 1 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 3 ( & s e l f )   - >   T e n s o r 4 S h a p e < T 3 ,   T 2 ,   T 1 ,   T 4 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 3 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 1 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 4 ( & s e l f )   - >   T e n s o r 4 S h a p e < T 4 ,   T 2 ,   T 3 ,   T 1 >   { 
 
                         T e n s o r 4 S h a p e   { 
 
                                 d 1 :   s e l f . d 4 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g >   T e n s o r 5 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 >   { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( 
 
                         & s e l f , 
 
                 )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 6 :   D i m T a g > ( & s e l f ,   d i m e n s i o n :   D i m < T 6 > )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 1 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e c o n d ( & s e l f )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 2 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 2 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ t h i r d ( & s e l f )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 3 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 3 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f o u r t h ( & s e l f )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 4 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 4 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i f t h ( & s e l f )   - >   T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 5 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 5 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 2 ( & s e l f )   - >   T e n s o r 5 S h a p e < T 2 ,   T 1 ,   T 3 ,   T 4 ,   T 5 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 2 , 
 
                                 d 2 :   s e l f . d 1 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 3 ( & s e l f )   - >   T e n s o r 5 S h a p e < T 3 ,   T 2 ,   T 1 ,   T 4 ,   T 5 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 3 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 1 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 4 ( & s e l f )   - >   T e n s o r 5 S h a p e < T 4 ,   T 2 ,   T 3 ,   T 1 ,   T 5 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 4 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 1 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 5 ( & s e l f )   - >   T e n s o r 5 S h a p e < T 5 ,   T 2 ,   T 3 ,   T 4 ,   T 1 >   { 
 
                         T e n s o r 5 S h a p e   { 
 
                                 d 1 :   s e l f . d 5 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g > 
 
                 T e n s o r 6 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 > 
 
         { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( 
 
                         & s e l f , 
 
                 )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 7 :   D i m T a g > ( 
 
                         & s e l f , 
 
                         d i m e n s i o n :   D i m < T 7 > , 
 
                 )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 1 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e c o n d ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 2 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 2 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ t h i r d ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 3 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 3 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f o u r t h ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 4 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 4 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i f t h ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 5 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 5 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s i x t h ( & s e l f )   - >   T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 6 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 6 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 2 ( & s e l f )   - >   T e n s o r 6 S h a p e < T 2 ,   T 1 ,   T 3 ,   T 4 ,   T 5 ,   T 6 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 2 , 
 
                                 d 2 :   s e l f . d 1 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 3 ( & s e l f )   - >   T e n s o r 6 S h a p e < T 3 ,   T 2 ,   T 1 ,   T 4 ,   T 5 ,   T 6 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 3 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 1 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 4 ( & s e l f )   - >   T e n s o r 6 S h a p e < T 4 ,   T 2 ,   T 3 ,   T 1 ,   T 5 ,   T 6 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 4 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 1 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 5 ( & s e l f )   - >   T e n s o r 6 S h a p e < T 5 ,   T 2 ,   T 3 ,   T 4 ,   T 1 ,   T 6 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 5 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 1 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 6 ( & s e l f )   - >   T e n s o r 6 S h a p e < T 6 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 1 >   { 
 
                         T e n s o r 6 S h a p e   { 
 
                                 d 1 :   s e l f . d 6 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   T 6 :   D i m T a g ,   T 7 :   D i m T a g > 
 
                 T e n s o r 7 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 > 
 
         { 
 
                 p u b   f n   w i t h _ s t a t i c < c o n s t   N :   u s i z e > ( 
 
                         & s e l f , 
 
                 )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   S t a t i c D i m T a g < N > >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   n e w _ s t a t i c _ d i m : : < N > ( ) , 
 
                                 s i z e :   s e l f . s i z e . c h e c k e d _ m u l ( N ) . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h < T 8 :   D i m T a g > ( 
 
                         & s e l f , 
 
                         d i m e n s i o n :   D i m < T 8 > , 
 
                 )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   d i m e n s i o n , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( d i m e n s i o n . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i r s t ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 1 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e c o n d ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 2 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 2 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ t h i r d ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 3 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 3 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f o u r t h ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 4 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 4 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ f i f t h ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 5 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 5 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s i x t h ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 6 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 6 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   w i t h _ s e v e n t h ( & s e l f )   - >   T e n s o r 8 S h a p e < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 7 >   { 
 
                         T e n s o r 8 S h a p e   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 7 , 
 
                                 s i z e :   s e l f 
 
                                         . s i z e 
 
                                         . c h e c k e d _ m u l ( s e l f . d 1 . a s _ u s i z e ( ) ) 
 
                                         . e x p e c t ( " T e n s o r   s i z e   i s   t o o   b i g " ) , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 2 ( & s e l f )   - >   T e n s o r 7 S h a p e < T 2 ,   T 1 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 2 , 
 
                                 d 2 :   s e l f . d 1 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 3 ( & s e l f )   - >   T e n s o r 7 S h a p e < T 3 ,   T 2 ,   T 1 ,   T 4 ,   T 5 ,   T 6 ,   T 7 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 3 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 1 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 4 ( & s e l f )   - >   T e n s o r 7 S h a p e < T 4 ,   T 2 ,   T 3 ,   T 1 ,   T 5 ,   T 6 ,   T 7 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 4 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 1 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 5 ( & s e l f )   - >   T e n s o r 7 S h a p e < T 5 ,   T 2 ,   T 3 ,   T 4 ,   T 1 ,   T 6 ,   T 7 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 5 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 1 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 6 ( & s e l f )   - >   T e n s o r 7 S h a p e < T 6 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 1 ,   T 7 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 6 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 1 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
                 p u b   f n   s w i t c h _ 1 7 ( & s e l f )   - >   T e n s o r 7 S h a p e < T 7 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 1 >   { 
 
                         T e n s o r 7 S h a p e   { 
 
                                 d 1 :   s e l f . d 7 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 1 , 
 
                                 s i z e :   s e l f . s i z e , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r P r e p a r a t i o n < T :   T e n s o r >   { 
 
                 e x p e c t e d _ s i z e :   u s i z e , 
 
                 s h a p e :   T : : S h a p e , 
 
                 d a t a :   V e c < T : : E l e m e n t > , 
 
                 g e n e r a t o r :   f n ( T : : S h a p e ,   V e c < T : : E l e m e n t > )   - >   T , 
 
         } 
 
         i m p l < T :   T e n s o r >   T e n s o r P r e p a r a t i o n < T >   { 
 
                 p u b   f n   c o u n t _ s e t _ e l e m e n t s ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . d a t a . l e n ( ) 
 
                 } 
 
                 p u b   f n   c o u n t _ u n s e t _ e l e m e n t s ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . e x p e c t e d _ s i z e   -   s e l f . d a t a . l e n ( ) 
 
                 } 
 
                 p u b   f n   a p p e n d _ v e c ( m u t   s e l f ,   v a l u e s :   & m u t   V e c < T : : E l e m e n t > )   - >   S e l f   { 
 
                         s e l f . d a t a . a p p e n d ( v a l u e s ) ; 
 
                         s e l f . d a t a . t r u n c a t e ( s e l f . e x p e c t e d _ s i z e ) ; 
 
                         s e l f 
 
                 } 
 
                 p u b   f n   a p p e n d _ a r r a y < c o n s t   N :   u s i z e > ( m u t   s e l f ,   v a l u e s :   [ T : : E l e m e n t ;   N ] )   - >   S e l f   { 
 
                         s e l f . d a t a . a p p e n d ( & m u t   V e c : : < _ > : : f r o m ( v a l u e s ) ) ; 
 
                         s e l f . d a t a . t r u n c a t e ( s e l f . e x p e c t e d _ s i z e ) ; 
 
                         s e l f 
 
                 } 
 
                 p u b   f n   f i l l ( m u t   s e l f ,   v a l u e :   & T : : E l e m e n t )   - >   T 
 
                 w h e r e 
 
                         T : : E l e m e n t :   C l o n e , 
 
                 { 
 
                         l e t   m i s s i n g _ e l e m e n t s _ c o u n t   =   s e l f . e x p e c t e d _ s i z e   -   s e l f . d a t a . l e n ( ) ; 
 
                         s e l f . d a t a . a p p e n d ( & m u t   : : a l l o c : : v e c : : f r o m _ e l e m ( 
 
                                 v a l u e . c l o n e ( ) , 
 
                                 m i s s i n g _ e l e m e n t s _ c o u n t , 
 
                         ) ) ; 
 
                         s e l f . g e n e r a t e ( ) 
 
                 } 
 
                 p u b   f n   f i l l _ d u r i n g ( m u t   s e l f ,   v a l u e :   & T : : E l e m e n t ,   a d d i t i o n a l _ c o u n t :   u s i z e )   - >   S e l f 
 
                 w h e r e 
 
                         T : : E l e m e n t :   C l o n e , 
 
                 { 
 
                         l e t   m i s s i n g _ e l e m e n t s _ c o u n t   = 
 
                                 ( s e l f . e x p e c t e d _ s i z e   -   s e l f . d a t a . l e n ( ) ) . m i n ( a d d i t i o n a l _ c o u n t ) ; 
 
                         s e l f . d a t a . a p p e n d ( & m u t   : : a l l o c : : v e c : : f r o m _ e l e m ( 
 
                                 v a l u e . c l o n e ( ) , 
 
                                 m i s s i n g _ e l e m e n t s _ c o u n t , 
 
                         ) ) ; 
 
                         s e l f 
 
                 } 
 
                 p u b   f n   g e n e r a t e ( s e l f )   - >   T   { 
 
                         i f   s e l f . d a t a . l e n ( )   ! =   s e l f . e x p e c t e d _ s i z e   { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( & [ " I n v a l i d   s i z e " ] ,   & [ ] ) ) 
 
                         } 
 
                         ( s e l f . g e n e r a t o r ) ( s e l f . s h a p e ,   s e l f . d a t a ) 
 
                 } 
 
                 p u b   f n   t r y _ g e n e r a t e ( s e l f )   - >   R e s u l t < T ,   S e l f >   { 
 
                         i f   s e l f . d a t a . l e n ( )   ! =   s e l f . e x p e c t e d _ s i z e   { 
 
                                 E r r ( s e l f ) 
 
                         }   e l s e   { 
 
                                 O k ( ( s e l f . g e n e r a t o r ) ( s e l f . s h a p e ,   s e l f . d a t a ) ) 
 
                         } 
 
                 } 
 
         } 
 
         p u b   t r a i t   T e n s o r B u i l d e r < V >   { 
 
                 t y p e   T e n s o r :   T e n s o r ; 
 
                 t y p e   M u l t i I n d e x :   E q   +   D e b u g   +   C o p y ; 
 
                 f n   f i l l ( & s e l f ,   v a l u e :   & V )   - >   S e l f : : T e n s o r 
 
                 w h e r e 
 
                         V :   C l o n e ; 
 
                 f n   d e f i n e ( & s e l f ,   f :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x )   - >   V )   - >   S e l f : : T e n s o r ; 
 
                 f n   p r e p a r e ( & s e l f )   - >   T e n s o r P r e p a r a t i o n < S e l f : : T e n s o r > ; 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r B u i l d e r < V >   f o r   T e n s o r 1 S h a p e < T >   { 
 
                 t y p e   T e n s o r   =   T e n s o r 1 < T ,   V > ; 
 
                 t y p e   M u l t i I n d e x   =   u s i z e ; 
 
                 f n   f i l l ( & s e l f ,   v a l u e :   & V )   - >   S e l f : : T e n s o r 
 
                 w h e r e 
 
                         V :   C l o n e , 
 
                 { 
 
                         S e l f : : T e n s o r   { 
 
                                 p h a n t o m :   P h a n t o m D a t a , 
 
                                 d a t a :   : : a l l o c : : v e c : : f r o m _ e l e m ( v a l u e . c l o n e ( ) ,   s e l f . c o u n t ( ) ) , 
 
                         } 
 
                 } 
 
                 f n   d e f i n e ( & s e l f ,   m u t   f :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x )   - >   V )   - >   S e l f : : T e n s o r   { 
 
                         l e t   m u t   d a t a   =   V e c : : < V > : : w i t h _ c a p a c i t y ( s e l f . d . a s _ u s i z e ( ) ) ; 
 
                         f o r   i   i n   0 . . s e l f . d . a s _ u s i z e ( )   { 
 
                                 d a t a . p u s h ( f ( i ) ) 
 
                         } 
 
                         S e l f : : T e n s o r   { 
 
                                 p h a n t o m :   P h a n t o m D a t a , 
 
                                 d a t a , 
 
                         } 
 
                 } 
 
                 f n   p r e p a r e ( & s e l f )   - >   T e n s o r P r e p a r a t i o n < S e l f : : T e n s o r >   { 
 
                         T e n s o r P r e p a r a t i o n   { 
 
                                 e x p e c t e d _ s i z e :   s e l f . c o u n t ( ) , 
 
                                 d a t a :   V e c : : < V > : : w i t h _ c a p a c i t y ( s e l f . c o u n t ( ) ) , 
 
                                 s h a p e :   ( s e l f . d , ) , 
 
                                 g e n e r a t o r :   | _ d i m s ,   d a t a |   S e l f : : T e n s o r   { 
 
                                         p h a n t o m :   P h a n t o m D a t a , 
 
                                         d a t a , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r B u i l d e r < V >   f o r   T e n s o r 2 S h a p e < T 1 ,   T 2 >   { 
 
                 t y p e   T e n s o r   =   T e n s o r 2 < T 1 ,   T 2 ,   V > ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ) ; 
 
                 f n   f i l l ( & s e l f ,   v a l u e :   & V )   - >   S e l f : : T e n s o r 
 
                 w h e r e 
 
                         V :   C l o n e , 
 
                 { 
 
                         S e l f : : T e n s o r   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d a t a :   : : a l l o c : : v e c : : f r o m _ e l e m ( v a l u e . c l o n e ( ) ,   s e l f . c o u n t ( ) ) , 
 
                         } 
 
                 } 
 
                 f n   d e f i n e ( & s e l f ,   m u t   f :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x )   - >   V )   - >   S e l f : : T e n s o r   { 
 
                         l e t   m u t   d a t a   =   V e c : : < V > : : w i t h _ c a p a c i t y ( s e l f . c o u n t ( ) ) ; 
 
                         f o r   i 1   i n   0 . . s e l f . d 1 . a s _ u s i z e ( )   { 
 
                                 f o r   i 2   i n   0 . . s e l f . d 2 . a s _ u s i z e ( )   { 
 
                                         d a t a . p u s h ( f ( ( i 1 ,   i 2 ) ) ) ; 
 
                                 } 
 
                         } 
 
                         S e l f : : T e n s o r   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d a t a , 
 
                         } 
 
                 } 
 
                 f n   p r e p a r e ( & s e l f )   - >   T e n s o r P r e p a r a t i o n < S e l f : : T e n s o r >   { 
 
                         T e n s o r P r e p a r a t i o n   { 
 
                                 e x p e c t e d _ s i z e :   s e l f . c o u n t ( ) , 
 
                                 d a t a :   V e c : : < V > : : w i t h _ c a p a c i t y ( s e l f . c o u n t ( ) ) , 
 
                                 s h a p e :   ( s e l f . d 1 ,   s e l f . d 2 ) , 
 
                                 g e n e r a t o r :   | s h a p e ,   d a t a |   S e l f : : T e n s o r   { 
 
                                         d 1 :   s h a p e . 0 , 
 
                                         d 2 :   s h a p e . 1 , 
 
                                         d a t a , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r B u i l d e r < V > 
 
                 f o r   T e n s o r 3 S h a p e < T 1 ,   T 2 ,   T 3 > 
 
         { 
 
                 t y p e   T e n s o r   =   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 f n   f i l l ( & s e l f ,   v a l u e :   & V )   - >   S e l f : : T e n s o r 
 
                 w h e r e 
 
                         V :   C l o n e , 
 
                 { 
 
                         S e l f : : T e n s o r   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d a t a :   : : a l l o c : : v e c : : f r o m _ e l e m ( v a l u e . c l o n e ( ) ,   s e l f . c o u n t ( ) ) , 
 
                         } 
 
                 } 
 
                 f n   d e f i n e ( & s e l f ,   m u t   f :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x )   - >   V )   - >   S e l f : : T e n s o r   { 
 
                         l e t   m u t   d a t a   =   V e c : : < V > : : w i t h _ c a p a c i t y ( s e l f . c o u n t ( ) ) ; 
 
                         f o r   i 1   i n   0 . . s e l f . d 1 . a s _ u s i z e ( )   { 
 
                                 f o r   i 2   i n   0 . . s e l f . d 2 . a s _ u s i z e ( )   { 
 
                                         f o r   i 3   i n   0 . . s e l f . d 3 . a s _ u s i z e ( )   { 
 
                                                 d a t a . p u s h ( f ( ( i 1 ,   i 2 ,   i 3 ) ) ) ; 
 
                                         } 
 
                                 } 
 
                         } 
 
                         S e l f : : T e n s o r   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d a t a , 
 
                         } 
 
                 } 
 
                 f n   p r e p a r e ( & s e l f )   - >   T e n s o r P r e p a r a t i o n < S e l f : : T e n s o r >   { 
 
                         T e n s o r P r e p a r a t i o n   { 
 
                                 e x p e c t e d _ s i z e :   s e l f . c o u n t ( ) , 
 
                                 d a t a :   V e c : : < V > : : w i t h _ c a p a c i t y ( s e l f . c o u n t ( ) ) , 
 
                                 s h a p e :   ( s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ) , 
 
                                 g e n e r a t o r :   | s h a p e ,   d a t a |   S e l f : : T e n s o r   { 
 
                                         d 1 :   s h a p e . 0 , 
 
                                         d 2 :   s h a p e . 1 , 
 
                                         d 3 :   s h a p e . 2 , 
 
                                         d a t a , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
 } 
 
 p u b   m o d   d i m e n s i o n s   { 
 
         / / !   A b s t r a c t i o n s   f o r   d i m e n s i o n s   u s e d   i n   a   t e n s o r . 
 
         u s e   s t d : : f m t : : { D e b u g ,   E r r o r ,   F o r m a t t e r } ; 
 
         u s e   s t d : : m a r k e r : : { C o p y ,   P h a n t o m D a t a } ; 
 
         u s e   s t d : : s y n c : : a t o m i c : : { A t o m i c U 1 6 ,   O r d e r i n g } ; 
 
         s t a t i c   C O U N T E R :   A t o m i c U 1 6   =   A t o m i c U 1 6 : : n e w ( 0 x F 0 9 1 ) ; 
 
         # [ d o c ( h i d d e n ) ] 
 
         p u b   f n   g e n e r a t e _ t h u m b p r i n t ( )   - >   u 1 6   { 
 
                 C O U N T E R 
 
                         . f e t c h _ u p d a t e ( O r d e r i n g : : R e l a x e d ,   O r d e r i n g : : R e l a x e d ,   | n |   { 
 
                                 S o m e ( n . w r a p p i n g _ m u l ( 0 x 9 C A 3 )   |   0 x 3 4 E 1 u 1 6 ) 
 
                         } ) 
 
                         . u n w r a p ( ) 
 
         } 
 
         / / /   A n   a b s t r a c t i o n   r e p r e s e n t i n g   a   s t a t i c   o r   d y n a m i c   i n f o r m a t i o n 
 
         / / /   a b o u t   a   d i m e n s i o n .   T y p e s   i m p l e m e n t i n g   D i m T a g   d o   n o t   n e e d   t o 
 
         / / /   b e   i n s t a n c i a b l e   a s   t h e i r   m a i n   p u r p o s e   i s   t o   r e p r e s e n t   d i m e n s i o n 
 
         / / /   i n   t h e   t y p e   s y s t e m . 
 
         p u b   t r a i t   D i m T a g :   P a r t i a l E q   +   C o p y   { 
 
                 / / /   R e t u r n s   a   u 1 6   u s e d   t o   n a m e   a   d y n a m i c   d i m e n s i o n   o r   N o n e 
 
                 / / /   i f   t h e   d i m e n s i o n   i s   s t a t i c a l l y   k n o w n .   T h i s   i s   m a i n l y   u s e d 
 
                 / / /   f o r   d i s p l a y i n g   d e b u g g i n g   i n f o r m a t i o n . 
 
                 f n   g e t _ t h u m b p r i n t ( )   - >   O p t i o n < u 1 6 > ; 
 
         } 
 
         / / /   A   t a g   r e p r e s e n t i n g   a   d i m e n s i o n   k n o w n   a t   c o m p i l e   t i m e . 
 
         p u b   e n u m   S t a t i c D i m T a g < c o n s t   N :   u s i z e >   { } 
 
         i m p l < c o n s t   N :   u s i z e >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   S t a t i c D i m T a g < N >   { } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < c o n s t   N :   u s i z e >   : : c o r e : : c m p : : P a r t i a l E q   f o r   S t a t i c D i m T a g < N >   { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & S t a t i c D i m T a g < N > )   - >   b o o l   { 
 
                         u n s a f e   {   : : c o r e : : i n t r i n s i c s : : u n r e a c h a b l e ( )   } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < c o n s t   N :   u s i z e >   : : c o r e : : c l o n e : : C l o n e   f o r   S t a t i c D i m T a g < N >   { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   S t a t i c D i m T a g < N >   { 
 
                         { 
 
                                 * s e l f 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < c o n s t   N :   u s i z e >   : : c o r e : : m a r k e r : : C o p y   f o r   S t a t i c D i m T a g < N >   { } 
 
         i m p l < c o n s t   N :   u s i z e >   D i m T a g   f o r   S t a t i c D i m T a g < N >   { 
 
                 f n   g e t _ t h u m b p r i n t ( )   - >   O p t i o n < u 1 6 >   { 
 
                         N o n e 
 
                 } 
 
         } 
 
         / / /   A   t y p e   w r a p p i n g   a   u s i z e   v a l u e   a n d   r e p r e s e n t i n g 
 
         / / /   a   d i m e n s i o n .   A l l   s a f e   c o n s t r u c t i o n   m e t h o d s   o f   i n s t a n c e s   f o r 
 
         / / /   t h i s   t y p e   m a k e s   s u r e   t h a t   t w o   i n s t a n c e s   w i t h   t h e   s a m e   t a g 
 
         / / /   n e c e s s a r i l y   r e p r e s e n t   t h e   s a m e   d i m e n s i o n . 
 
         p u b   s t r u c t   D i m < T :   D i m T a g >   { 
 
                 p h a n t o m :   P h a n t o m D a t a < T > , 
 
                 v :   u s i z e , 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T :   : : c o r e : : c l o n e : : C l o n e   +   D i m T a g >   : : c o r e : : c l o n e : : C l o n e   f o r   D i m < T >   { 
 
                 # [ i n l i n e ] 
 
                 f n   c l o n e ( & s e l f )   - >   D i m < T >   { 
 
                         m a t c h   * s e l f   { 
 
                                 S e l f   { 
 
                                         p h a n t o m :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         v :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                 }   = >   D i m   { 
 
                                         p h a n t o m :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 0 ) ) , 
 
                                         v :   : : c o r e : : c l o n e : : C l o n e : : c l o n e ( & ( * _ _ s e l f _ 0 _ 1 ) ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T :   : : c o r e : : m a r k e r : : C o p y   +   D i m T a g >   : : c o r e : : m a r k e r : : C o p y   f o r   D i m < T >   { } 
 
         i m p l < T :   D i m T a g >   D i m < T >   { 
 
                 # [ d o c ( h i d d e n ) ] 
 
                 p u b   u n s a f e   f n   u n s a f e _ n e w ( v :   u s i z e )   - >   S e l f   { 
 
                         D i m   { 
 
                                 p h a n t o m :   P h a n t o m D a t a   { } , 
 
                                 v , 
 
                         } 
 
                 } 
 
                 / / /   R e t u r n   t h e   d i m e n s i o n   a s   a   u s i z e . 
 
                 p u b   f n   a s _ u s i z e ( & s e l f )   - >   u s i z e   { 
 
                         s e l f . v 
 
                 } 
 
                 / / /   R e t u r n s   t h e   t h u m b p r i n t   o f   t h e   T .   A s   f o r   t a g s 
 
                 / / /   t h i s   v a l u e   i s   m a i n l y   u s e d 
 
                 / / /   f o r   d i s p l a y i n g   d e b u g g i n g   i n f o r m a t i o n . 
 
                 p u b   f n   g e t _ t h u m b p r i n t ( & s e l f )   - >   O p t i o n < u 1 6 >   { 
 
                         T : : g e t _ t h u m b p r i n t ( ) 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g >   D e b u g   f o r   D i m < T >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         l e t   t p   =   T : : g e t _ t h u m b p r i n t ( ) ; 
 
                         s e l f . v . f m t ( f o r m a t t e r ) ? ; 
 
                         i f   l e t   S o m e ( t p )   =   t p   { 
 
                                 f o r m a t t e r . w r i t e _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 _ f o r m a t t e d ( 
 
                                         & [ " \ u { 2 0 2 2 } " ] , 
 
                                         & [ : : c o r e : : f m t : : A r g u m e n t V 1 : : n e w _ l o w e r _ h e x ( & t p ) ] , 
 
                                         & [ : : c o r e : : f m t : : r t : : v 1 : : A r g u m e n t   { 
 
                                                 p o s i t i o n :   0 u s i z e , 
 
                                                 f o r m a t :   : : c o r e : : f m t : : r t : : v 1 : : F o r m a t S p e c   { 
 
                                                         f i l l :   '   ' , 
 
                                                         a l i g n :   : : c o r e : : f m t : : r t : : v 1 : : A l i g n m e n t : : U n k n o w n , 
 
                                                         f l a g s :   8 u 3 2 , 
 
                                                         p r e c i s i o n :   : : c o r e : : f m t : : r t : : v 1 : : C o u n t : : I m p l i e d , 
 
                                                         w i d t h :   : : c o r e : : f m t : : r t : : v 1 : : C o u n t : : I s ( 4 u s i z e ) , 
 
                                                 } , 
 
                                         } ] , 
 
                                         u n s a f e   {   : : c o r e : : f m t : : U n s a f e A r g : : n e w ( )   } , 
 
                                 ) ) ? ; 
 
                         } 
 
                         O k ( ( ) ) 
 
                 } 
 
         } 
 
         i m p l < T L h s :   D i m T a g ,   T R h s :   D i m T a g >   P a r t i a l E q < D i m < T R h s > >   f o r   D i m < T L h s >   { 
 
                 f n   e q ( & s e l f ,   o t h e r :   & D i m < T R h s > )   - >   b o o l   { 
 
                         s e l f . v   = =   o t h e r . v 
 
                 } 
 
         } 
 
         # [ d o c ( h i d d e n ) ] 
 
         p u b   f n   i d e n t i c a l < T :   D i m T a g > ( _ d 1 :   D i m < T > ,   _ d 2 :   D i m < T > )   { } 
 
         i m p l < T :   D i m T a g >   E q   f o r   D i m < T >   { } 
 
         / / /   A n   a l i a s   r e p r e s e n t i n g   a   s t a t i c l y   k n o w n   d i m e n s i o n 
 
         p u b   t y p e   S t a t i c D i m < c o n s t   N :   u s i z e >   =   D i m < S t a t i c D i m T a g < N > > ; 
 
         / / /   G e n e r a t e   a   n e w   d i m e n s i o n   w r a p p i n g   t h e   c o n s t a n t   s i z e   N . 
 
         p u b   f n   n e w _ s t a t i c _ d i m < c o n s t   N :   u s i z e > ( )   - >   D i m < S t a t i c D i m T a g < N > >   { 
 
                 D i m   { 
 
                         p h a n t o m :   P h a n t o m D a t a   { } , 
 
                         v :   N , 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g >   F r o m < D i m < T > >   f o r   u s i z e   { 
 
                 f n   f r o m ( d i m :   D i m < T > )   - >   S e l f   { 
 
                         d i m . v 
 
                 } 
 
         } 
 
 } 
 
 p u b   m o d   t e n s o r s   { 
 
         / / !   T h e   m a t h e m a t i c a l   w o r d   [ t e n s o r ] ( h t t p s : / / e n . w i k i p e d i a . o r g / w i k i / T e n s o r )   i s   u s e d   h e r e   t o   d e s c r i b e   m o r e   b r o a d l y 
 
         / / !   a r r a y s   w i t h   m u l t i p l e   i n d e x e s . 
 
         / / ! 
 
         / / ! 
 
         u s e   s u p e r : : d i m e n s i o n s : : * ; 
 
         u s e   s t d : : f m t : : { D e b u g ,   E r r o r ,   F o r m a t t e r } ; 
 
         u s e   s t d : : m a r k e r : : { C o p y ,   P h a n t o m D a t a } ; 
 
         u s e   s t d : : o p s : : { I n d e x ,   I n d e x M u t } ; 
 
         / / /   A   g e n e r a l   t r a i t   s h a r e d   b y   a l l   t e n s o r   t y p e s . 
 
         p u b   t r a i t   T e n s o r : 
 
                 P a r t i a l E q   +   I n d e x < S e l f : : M u l t i I n d e x >   +   I n d e x M u t < S e l f : : M u l t i I n d e x >   +   D e b u g 
 
         { 
 
                 / / /   T h e   t y p e   o f   e l e m e n t s   s t o r e d   i n   t h e   t e n s o r . 
 
                 t y p e   E l e m e n t :   P a r t i a l E q   +   D e b u g ; 
 
                 / / /   T h e   t y p e   o f   t h e   d i m e n s i o n s   t u p l e 
 
                 t y p e   S h a p e :   C o p y   +   E q   +   D e b u g ; 
 
                 t y p e   M u l t i I n d e x :   C o p y   +   E q   +   D e b u g ; 
 
                 / / /   T h e   n u m b e r   o f   d i m e n s i o n s ,   a l s o   c o r r e s p o n d i n g 
 
                 / / /   t o   t h e   n u m b e r   o f   i n d e x e s . 
 
                 c o n s t   R A N K :   u 1 6 ; 
 
                 / / /   T h e   t o t a l   n u m b e r   o f   c o o r d i n a t e s 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4 ; 
 
                 / / /   T h e   t u p l e   o f   d i m e n s i o n s 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e ; 
 
                 / / /   U p d a t e   s o m e   e l e m e n t s   o f   t h e   t e n s o r 
 
                 f n   u p d a t e ( & m u t   s e l f ,   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   S e l f : : E l e m e n t ) ) ; 
 
         } 
 
         / / /   A   t e n s o r   o f   r a n k   0   ( t h a t   i s   t o   s a y   a   s c a l a r )   c o n t a i n i n g   a   s i n g l e   v a l u e   o f   t y p e   V . 
 
         p u b   s t r u c t   T e n s o r 0 < V :   P a r t i a l E q   +   D e b u g >   { 
 
                 p u b ( c r a t e )   d a t a :   V , 
 
         } 
 
         i m p l < V :   P a r t i a l E q   +   D e b u g >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 0 < V >   { } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 0 < V >   { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 0 < V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         }   = >   ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 0 < V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                         }   = >   ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         / / /   A   t e n s o r   o f   r a n k   $ m   a n d   d i m e n s i o n   r e p r e s e n t e d   b y   t a g s   $ ( $ p ) , *   c o n t a i n i n g   v a l u e s   o f   t y p e   V . 
 
         p u b   s t r u c t   T e n s o r 1 < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   { 
 
                 p u b ( c r a t e )   T :   P h a n t o m D a t a < T > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 1 < T ,   V >   { } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < T :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g ,   V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g > 
 
                 : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 1 < T ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 1 < T ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         T :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 T :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         }   = >   ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 )   & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 1 < T ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         T :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 T :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                         }   = >   ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 )   | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) , 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 2 < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q 
 
                 f o r   T e n s o r 2 < T 1 ,   T 2 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 2 < T 1 ,   T 2 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 2 < T 1 ,   T 2 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 2 < T 1 ,   T 2 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 3 < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 3 )   = =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 3 )   ! =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 4 < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 3 )   = =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 4 )   = =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 3 )   ! =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 4 )   ! =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 5 < 
 
                 T 1 :   D i m T a g , 
 
                 T 2 :   D i m T a g , 
 
                 T 3 :   D i m T a g , 
 
                 T 4 :   D i m T a g , 
 
                 T 5 :   D i m T a g , 
 
                 V :   P a r t i a l E q   +   D e b u g , 
 
         >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 3 )   = =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 4 )   = =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 5 )   = =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 3 )   ! =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 4 )   ! =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 5 )   ! =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 6 < 
 
                 T 1 :   D i m T a g , 
 
                 T 2 :   D i m T a g , 
 
                 T 3 :   D i m T a g , 
 
                 T 4 :   D i m T a g , 
 
                 T 5 :   D i m T a g , 
 
                 T 6 :   D i m T a g , 
 
                 V :   P a r t i a l E q   +   D e b u g , 
 
         >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d 6 :   D i m < T 6 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 6 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 3 )   = =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 4 )   = =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 5 )   = =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 6 )   = =   ( * _ _ s e l f _ 1 _ 6 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 6 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 3 )   ! =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 4 )   ! =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 5 )   ! =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 6 )   ! =   ( * _ _ s e l f _ 1 _ 6 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 7 < 
 
                 T 1 :   D i m T a g , 
 
                 T 2 :   D i m T a g , 
 
                 T 3 :   D i m T a g , 
 
                 T 4 :   D i m T a g , 
 
                 T 5 :   D i m T a g , 
 
                 T 6 :   D i m T a g , 
 
                 T 7 :   D i m T a g , 
 
                 V :   P a r t i a l E q   +   D e b u g , 
 
         >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d 6 :   D i m < T 6 > , 
 
                 p u b ( c r a t e )   d 7 :   D i m < T 7 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 7 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                         d 7 :   r e f   _ _ s e l f _ 1 _ 6 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 7 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                                 d 7 :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 7 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 3 )   = =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 4 )   = =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 5 )   = =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 6 )   = =   ( * _ _ s e l f _ 1 _ 6 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 7 )   = =   ( * _ _ s e l f _ 1 _ 7 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                         d 7 :   r e f   _ _ s e l f _ 1 _ 6 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 7 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                                 d 7 :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 7 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 3 )   ! =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 4 )   ! =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 5 )   ! =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 6 )   ! =   ( * _ _ s e l f _ 1 _ 6 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 7 )   ! =   ( * _ _ s e l f _ 1 _ 7 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   s t r u c t   T e n s o r 8 < 
 
                 T 1 :   D i m T a g , 
 
                 T 2 :   D i m T a g , 
 
                 T 3 :   D i m T a g , 
 
                 T 4 :   D i m T a g , 
 
                 T 5 :   D i m T a g , 
 
                 T 6 :   D i m T a g , 
 
                 T 7 :   D i m T a g , 
 
                 T 8 :   D i m T a g , 
 
                 V :   P a r t i a l E q   +   D e b u g , 
 
         >   { 
 
                 p u b ( c r a t e )   d 1 :   D i m < T 1 > , 
 
                 p u b ( c r a t e )   d 2 :   D i m < T 2 > , 
 
                 p u b ( c r a t e )   d 3 :   D i m < T 3 > , 
 
                 p u b ( c r a t e )   d 4 :   D i m < T 4 > , 
 
                 p u b ( c r a t e )   d 5 :   D i m < T 5 > , 
 
                 p u b ( c r a t e )   d 6 :   D i m < T 6 > , 
 
                 p u b ( c r a t e )   d 7 :   D i m < T 7 > , 
 
                 p u b ( c r a t e )   d 8 :   D i m < T 8 > , 
 
                 p u b ( c r a t e )   d a t a :   V e c < V > , 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : m a r k e r : : S t r u c t u r a l P a r t i a l E q   f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
         } 
 
         # [ a u t o m a t i c a l l y _ d e r i v e d ] 
 
         # [ a l l o w ( u n u s e d _ q u a l i f i c a t i o n s ) ] 
 
         i m p l < 
 
                         T 1 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 2 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 3 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 4 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 5 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 6 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 7 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         T 8 :   : : c o r e : : c m p : : P a r t i a l E q   +   D i m T a g , 
 
                         V :   : : c o r e : : c m p : : P a r t i a l E q   +   P a r t i a l E q   +   D e b u g , 
 
                 >   : : c o r e : : c m p : : P a r t i a l E q   f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 # [ i n l i n e ] 
 
                 f n   e q ( & s e l f ,   o t h e r :   & T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                         d 7 :   r e f   _ _ s e l f _ 1 _ 6 , 
 
                                         d 8 :   r e f   _ _ s e l f _ 1 _ 7 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 8 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                                 d 7 :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                                 d 8 :   r e f   _ _ s e l f _ 0 _ 7 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 8 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   = =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 1 )   = =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 2 )   = =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 3 )   = =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 4 )   = =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 5 )   = =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 6 )   = =   ( * _ _ s e l f _ 1 _ 6 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 7 )   = =   ( * _ _ s e l f _ 1 _ 7 ) 
 
                                                         & &   ( * _ _ s e l f _ 0 _ 8 )   = =   ( * _ _ s e l f _ 1 _ 8 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
                 # [ i n l i n e ] 
 
                 f n   n e ( & s e l f ,   o t h e r :   & T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > )   - >   b o o l   { 
 
                         m a t c h   * o t h e r   { 
 
                                 S e l f   { 
 
                                         d 1 :   r e f   _ _ s e l f _ 1 _ 0 , 
 
                                         d 2 :   r e f   _ _ s e l f _ 1 _ 1 , 
 
                                         d 3 :   r e f   _ _ s e l f _ 1 _ 2 , 
 
                                         d 4 :   r e f   _ _ s e l f _ 1 _ 3 , 
 
                                         d 5 :   r e f   _ _ s e l f _ 1 _ 4 , 
 
                                         d 6 :   r e f   _ _ s e l f _ 1 _ 5 , 
 
                                         d 7 :   r e f   _ _ s e l f _ 1 _ 6 , 
 
                                         d 8 :   r e f   _ _ s e l f _ 1 _ 7 , 
 
                                         d a t a :   r e f   _ _ s e l f _ 1 _ 8 , 
 
                                 }   = >   m a t c h   * s e l f   { 
 
                                         S e l f   { 
 
                                                 d 1 :   r e f   _ _ s e l f _ 0 _ 0 , 
 
                                                 d 2 :   r e f   _ _ s e l f _ 0 _ 1 , 
 
                                                 d 3 :   r e f   _ _ s e l f _ 0 _ 2 , 
 
                                                 d 4 :   r e f   _ _ s e l f _ 0 _ 3 , 
 
                                                 d 5 :   r e f   _ _ s e l f _ 0 _ 4 , 
 
                                                 d 6 :   r e f   _ _ s e l f _ 0 _ 5 , 
 
                                                 d 7 :   r e f   _ _ s e l f _ 0 _ 6 , 
 
                                                 d 8 :   r e f   _ _ s e l f _ 0 _ 7 , 
 
                                                 d a t a :   r e f   _ _ s e l f _ 0 _ 8 , 
 
                                         }   = >   { 
 
                                                 ( * _ _ s e l f _ 0 _ 0 )   ! =   ( * _ _ s e l f _ 1 _ 0 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 1 )   ! =   ( * _ _ s e l f _ 1 _ 1 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 2 )   ! =   ( * _ _ s e l f _ 1 _ 2 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 3 )   ! =   ( * _ _ s e l f _ 1 _ 3 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 4 )   ! =   ( * _ _ s e l f _ 1 _ 4 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 5 )   ! =   ( * _ _ s e l f _ 1 _ 5 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 6 )   ! =   ( * _ _ s e l f _ 1 _ 6 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 7 )   ! =   ( * _ _ s e l f _ 1 _ 7 ) 
 
                                                         | |   ( * _ _ s e l f _ 0 _ 8 )   ! =   ( * _ _ s e l f _ 1 _ 8 ) 
 
                                         } 
 
                                 } , 
 
                         } 
 
                 } 
 
         } 
 
         p u b   t y p e   S c a l a r < V >   =   T e n s o r 0 < V > ; 
 
         p u b   t y p e   V e c t o r < T ,   V >   =   T e n s o r 1 < T ,   V > ; 
 
         p u b   t y p e   M a t r i x < T 1 ,   T 2 ,   V >   =   T e n s o r 2 < T 1 ,   T 2 ,   V > ; 
 
         p u b   t y p e   S t a t i c V e c t o r < c o n s t   N :   u s i z e ,   V >   =   T e n s o r 1 < S t a t i c D i m T a g < N > ,   V > ; 
 
         p u b   t y p e   S t a t i c M a t r i x < c o n s t   N 1 :   u s i z e ,   c o n s t   N 2 :   u s i z e ,   V >   = 
 
                 T e n s o r 2 < S t a t i c D i m T a g < N 1 > ,   S t a t i c D i m T a g < N 2 > ,   V > ; 
 
         i m p l < V :   P a r t i a l E q   +   D e b u g >   T e n s o r   f o r   T e n s o r 0 < V >   { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   0 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         1 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( ( ) ,   & m u t   V ) )   { 
 
                         u p d a t e r ( ( ) ,   & m u t   s e l f . d a t a ) 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r   f o r   T e n s o r 1 < T ,   V >   { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( D i m < T > , ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e , ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   1 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         l e t   n   =   s e l f . d a t a . l e n ( ) ; 
 
                         u n s a f e   {   ( D i m : : < T > : : u n s a f e _ n e w ( n ) , )   } 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         f o r   ( i ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 u p d a t e r ( ( i , ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r   f o r   T e n s o r 2 < T 1 ,   T 2 ,   V >   { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( D i m < T 1 > ,   D i m < T 2 > ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   2 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( s e l f . d 1 ,   s e l f . d 2 ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         f o r   ( i ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 2   =   i   %   d 2 ; 
 
                                 l e t   i 1   =   i   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r   f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V >   { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( D i m < T 1 > ,   D i m < T 2 > ,   D i m < T 3 > ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   3 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( ( u s i z e ,   u s i z e ,   u s i z e ) ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( ) ; 
 
                         f o r   ( j ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 3   =   j   %   d 3 ; 
 
                                 l e t   j   =   j   /   d 3 ; 
 
                                 l e t   i 2   =   j   %   d 2 ; 
 
                                 l e t   i 1   =   j   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ,   i 3 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r 
 
                 f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( D i m < T 1 > ,   D i m < T 2 > ,   D i m < T 3 > ,   D i m < T 4 > ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   4 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ,   s e l f . d 4 ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( ) ; 
 
                         l e t   d 4   =   s e l f . d 4 . a s _ u s i z e ( ) ; 
 
                         f o r   ( j ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 4   =   j   %   d 4 ; 
 
                                 l e t   j   =   j   /   d 4 ; 
 
                                 l e t   i 3   =   j   %   d 3 ; 
 
                                 l e t   j   =   j   /   d 3 ; 
 
                                 l e t   i 2   =   j   %   d 2 ; 
 
                                 l e t   i 1   =   j   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r 
 
                 f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( D i m < T 1 > ,   D i m < T 2 > ,   D i m < T 3 > ,   D i m < T 4 > ,   D i m < T 5 > ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   5 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ,   s e l f . d 4 ,   s e l f . d 5 ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( ) ; 
 
                         l e t   d 4   =   s e l f . d 4 . a s _ u s i z e ( ) ; 
 
                         l e t   d 5   =   s e l f . d 5 . a s _ u s i z e ( ) ; 
 
                         f o r   ( j ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 5   =   j   %   d 5 ; 
 
                                 l e t   j   =   j   /   d 5 ; 
 
                                 l e t   i 4   =   j   %   d 4 ; 
 
                                 l e t   j   =   j   /   d 4 ; 
 
                                 l e t   i 3   =   j   %   d 3 ; 
 
                                 l e t   j   =   j   /   d 3 ; 
 
                                 l e t   i 2   =   j   %   d 2 ; 
 
                                 l e t   i 1   =   j   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   T e n s o r   f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( D i m < T 1 > ,   D i m < T 2 > ,   D i m < T 3 > ,   D i m < T 4 > ,   D i m < T 5 > ,   D i m < T 6 > ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   6 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ,   s e l f . d 4 ,   s e l f . d 5 ,   s e l f . d 6 ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( ) ; 
 
                         l e t   d 4   =   s e l f . d 4 . a s _ u s i z e ( ) ; 
 
                         l e t   d 5   =   s e l f . d 5 . a s _ u s i z e ( ) ; 
 
                         l e t   d 6   =   s e l f . d 6 . a s _ u s i z e ( ) ; 
 
                         f o r   ( j ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 6   =   j   %   d 6 ; 
 
                                 l e t   j   =   j   /   d 6 ; 
 
                                 l e t   i 5   =   j   %   d 5 ; 
 
                                 l e t   j   =   j   /   d 5 ; 
 
                                 l e t   i 4   =   j   %   d 4 ; 
 
                                 l e t   j   =   j   /   d 4 ; 
 
                                 l e t   i 3   =   j   %   d 3 ; 
 
                                 l e t   j   =   j   /   d 3 ; 
 
                                 l e t   i 2   =   j   %   d 2 ; 
 
                                 l e t   i 1   =   j   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   T e n s o r   f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( 
 
                         D i m < T 1 > , 
 
                         D i m < T 2 > , 
 
                         D i m < T 3 > , 
 
                         D i m < T 4 > , 
 
                         D i m < T 5 > , 
 
                         D i m < T 6 > , 
 
                         D i m < T 7 > , 
 
                 ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   7 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( 
 
                                 s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ,   s e l f . d 4 ,   s e l f . d 5 ,   s e l f . d 6 ,   s e l f . d 7 , 
 
                         ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( ) ; 
 
                         l e t   d 4   =   s e l f . d 4 . a s _ u s i z e ( ) ; 
 
                         l e t   d 5   =   s e l f . d 5 . a s _ u s i z e ( ) ; 
 
                         l e t   d 6   =   s e l f . d 6 . a s _ u s i z e ( ) ; 
 
                         l e t   d 7   =   s e l f . d 7 . a s _ u s i z e ( ) ; 
 
                         f o r   ( j ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 7   =   j   %   d 7 ; 
 
                                 l e t   j   =   j   /   d 7 ; 
 
                                 l e t   i 6   =   j   %   d 6 ; 
 
                                 l e t   j   =   j   /   d 6 ; 
 
                                 l e t   i 5   =   j   %   d 5 ; 
 
                                 l e t   j   =   j   /   d 5 ; 
 
                                 l e t   i 4   =   j   %   d 4 ; 
 
                                 l e t   j   =   j   /   d 4 ; 
 
                                 l e t   i 3   =   j   %   d 3 ; 
 
                                 l e t   j   =   j   /   d 3 ; 
 
                                 l e t   i 2   =   j   %   d 2 ; 
 
                                 l e t   i 1   =   j   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   T e n s o r   f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 t y p e   E l e m e n t   =   V ; 
 
                 t y p e   S h a p e   =   ( 
 
                         D i m < T 1 > , 
 
                         D i m < T 2 > , 
 
                         D i m < T 3 > , 
 
                         D i m < T 4 > , 
 
                         D i m < T 5 > , 
 
                         D i m < T 6 > , 
 
                         D i m < T 7 > , 
 
                         D i m < T 8 > , 
 
                 ) ; 
 
                 t y p e   M u l t i I n d e x   =   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) ; 
 
                 c o n s t   R A N K :   u 1 6   =   8 ; 
 
                 f n   c o u n t ( & s e l f )   - >   u 6 4   { 
 
                         s e l f . d a t a . l e n ( )   a s   u 6 4 
 
                 } 
 
                 f n   s h a p e ( & s e l f )   - >   S e l f : : S h a p e   { 
 
                         ( 
 
                                 s e l f . d 1 ,   s e l f . d 2 ,   s e l f . d 3 ,   s e l f . d 4 ,   s e l f . d 5 ,   s e l f . d 6 ,   s e l f . d 7 ,   s e l f . d 8 , 
 
                         ) 
 
                 } 
 
                 f n   u p d a t e ( & m u t   s e l f ,   m u t   u p d a t e r :   i m p l   F n M u t ( S e l f : : M u l t i I n d e x ,   & m u t   V ) )   { 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( ) ; 
 
                         l e t   d 4   =   s e l f . d 4 . a s _ u s i z e ( ) ; 
 
                         l e t   d 5   =   s e l f . d 5 . a s _ u s i z e ( ) ; 
 
                         l e t   d 6   =   s e l f . d 6 . a s _ u s i z e ( ) ; 
 
                         l e t   d 7   =   s e l f . d 7 . a s _ u s i z e ( ) ; 
 
                         l e t   d 8   =   s e l f . d 8 . a s _ u s i z e ( ) ; 
 
                         f o r   ( j ,   e l e m e n t )   i n   s e l f . d a t a . i t e r _ m u t ( ) . e n u m e r a t e ( )   { 
 
                                 l e t   i 8   =   j   %   d 8 ; 
 
                                 l e t   j   =   j   /   d 8 ; 
 
                                 l e t   i 7   =   j   %   d 7 ; 
 
                                 l e t   j   =   j   /   d 7 ; 
 
                                 l e t   i 6   =   j   %   d 6 ; 
 
                                 l e t   j   =   j   /   d 6 ; 
 
                                 l e t   i 5   =   j   %   d 5 ; 
 
                                 l e t   j   =   j   /   d 5 ; 
 
                                 l e t   i 4   =   j   %   d 4 ; 
 
                                 l e t   j   =   j   /   d 4 ; 
 
                                 l e t   i 3   =   j   %   d 3 ; 
 
                                 l e t   j   =   j   /   d 3 ; 
 
                                 l e t   i 2   =   j   %   d 2 ; 
 
                                 l e t   i 1   =   j   /   d 2 ; 
 
                                 u p d a t e r ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) ,   e l e m e n t ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < V :   C l o n e   +   P a r t i a l E q   +   D e b u g >   C l o n e   f o r   T e n s o r 0 < V >   { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < V :   C o p y   +   P a r t i a l E q   +   D e b u g >   C o p y   f o r   T e n s o r 0 < V >   { } 
 
         i m p l < T :   D i m T a g ,   V :   C l o n e   +   P a r t i a l E q   +   D e b u g >   C l o n e   f o r   T e n s o r 1 < T ,   V >   { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 p h a n t o m :   P h a n t o m D a t a   { } , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   C l o n e   +   P a r t i a l E q   +   D e b u g >   C l o n e   f o r   T e n s o r 2 < T 1 ,   T 2 ,   V >   { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   C l o n e   +   P a r t i a l E q   +   D e b u g >   C l o n e 
 
                 f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > 
 
         { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   C l o n e   +   P a r t i a l E q   +   D e b u g >   C l o n e 
 
                 f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         V :   C l o n e   +   P a r t i a l E q   +   D e b u g , 
 
                 >   C l o n e   f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   C l o n e   +   P a r t i a l E q   +   D e b u g , 
 
                 >   C l o n e   f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   C l o n e   +   P a r t i a l E q   +   D e b u g , 
 
                 >   C l o n e   f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   C l o n e   +   P a r t i a l E q   +   D e b u g , 
 
                 >   C l o n e   f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 f n   c l o n e ( & s e l f )   - >   S e l f   { 
 
                         S e l f   { 
 
                                 d 1 :   s e l f . d 1 , 
 
                                 d 2 :   s e l f . d 2 , 
 
                                 d 3 :   s e l f . d 3 , 
 
                                 d 4 :   s e l f . d 4 , 
 
                                 d 5 :   s e l f . d 5 , 
 
                                 d 6 :   s e l f . d 6 , 
 
                                 d 7 :   s e l f . d 7 , 
 
                                 d 8 :   s e l f . d 8 , 
 
                                 d a t a :   s e l f . d a t a . c l o n e ( ) , 
 
                         } 
 
                 } 
 
         } 
 
         c o n s t   F O R M A T E D _ E L E M E N T _ M A X _ C O U N T :   u s i z e   =   1 0 ; 
 
         i m p l < V :   P a r t i a l E q   +   D e b u g >   D e b u g   f o r   T e n s o r 0 < V >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } \ u { 3 0 0 9 } [ " ) ? ; 
 
                         s e l f . d a t a . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ] " ) 
 
                 } 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   d i s p l a y < ' a ,   V :   ' a   +   D e b u g > ( 
 
                 i t e r :   i m p l   I t e r a t o r < I t e m   =   & ' a   V > , 
 
                 ( d 4 ,   d 3 ,   d 2 ) :   ( u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > , 
 
         )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                 f o r   ( i ,   e l t )   i n   i t e r . e n u m e r a t e ( )   { 
 
                         i f   i   >   0   { 
 
                                 i f   d 4   ! =   0   & &   i   %   d 4   = =   0   { 
 
                                         f o r m a t t e r . w r i t e _ s t r ( "   | | |   " ) ? 
 
                                 }   e l s e   i f   d 3   ! =   0   & &   i   %   d 3   = =   0   { 
 
                                         f o r m a t t e r . w r i t e _ s t r ( "   | |   " ) ? 
 
                                 }   e l s e   i f   d 2   ! =   0   & &   i   %   d 2   = =   0   { 
 
                                         f o r m a t t e r . w r i t e _ s t r ( "   |   " ) ? 
 
                                 }   e l s e   { 
 
                                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? 
 
                                 } 
 
                         } 
 
                         e l t . f m t ( f o r m a t t e r ) ? ; 
 
                 } 
 
                 O k ( ( ) ) 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   D e b u g   f o r   T e n s o r 1 < T ,   V >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         l e t   d   =   u n s a f e   {   D i m : : < T > : : u n s a f e _ n e w ( s e l f . d a t a . l e n ( ) )   } ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         d . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   s h o w _ a l l   =   f o r m a t t e r . a l t e r n a t e ( ) ; 
 
                         i f   s h o w _ a l l   { 
 
                                 d i s p l a y ( s e l f . d a t a . i t e r ( ) ,   ( 0 ,   0 ,   0 ) ,   f o r m a t t e r ) ? 
 
                         }   e l s e   { 
 
                                 d i s p l a y ( 
 
                                         s e l f . d a t a . i t e r ( ) . t a k e ( F O R M A T E D _ E L E M E N T _ M A X _ C O U N T ) , 
 
                                         ( 0 ,   0 ,   0 ) , 
 
                                         f o r m a t t e r , 
 
                                 ) ? 
 
                         } 
 
                         i f   s h o w _ a l l   | |   s e l f . d a t a . l e n ( )   < =   F O R M A T E D _ E L E M E N T _ M A X _ C O U N T   { 
 
                                 f o r m a t t e r . w r i t e _ s t r ( " ] " ) 
 
                         }   e l s e   { 
 
                                 f o r m a t t e r . w r i t e _ s t r ( " ,   \ u { 2 0 2 6 } ] " ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   D e b u g   f o r   T e n s o r 2 < T 1 ,   T 2 ,   V >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   s h o w _ a l l   =   f o r m a t t e r . a l t e r n a t e ( ) ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         i f   s h o w _ a l l   { 
 
                                 d i s p l a y ( s e l f . d a t a . i t e r ( ) ,   ( 0 ,   0 ,   d 2 ) ,   f o r m a t t e r ) ? 
 
                         }   e l s e   { 
 
                                 d i s p l a y ( 
 
                                         s e l f . d a t a . i t e r ( ) . t a k e ( F O R M A T E D _ E L E M E N T _ M A X _ C O U N T ) , 
 
                                         ( 0 ,   0 ,   d 2 ) , 
 
                                         f o r m a t t e r , 
 
                                 ) ? 
 
                         } 
 
                         i f   s h o w _ a l l   | |   s e l f . d a t a . l e n ( )   < =   F O R M A T E D _ E L E M E N T _ M A X _ C O U N T   { 
 
                                 f o r m a t t e r . w r i t e _ s t r ( " ] " ) 
 
                         }   e l s e   { 
 
                                 f o r m a t t e r . w r i t e _ s t r ( " ,   \ u { 2 0 2 6 } ] " ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   D e b u g   f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V >   { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   s h o w _ a l l   =   f o r m a t t e r . a l t e r n a t e ( ) ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 2 ; 
 
                         i f   s h o w _ a l l   { 
 
                                 d i s p l a y ( s e l f . d a t a . i t e r ( ) ,   ( 0 ,   d 3 ,   d 2 ) ,   f o r m a t t e r ) ? 
 
                         }   e l s e   { 
 
                                 d i s p l a y ( 
 
                                         s e l f . d a t a . i t e r ( ) . t a k e ( F O R M A T E D _ E L E M E N T _ M A X _ C O U N T ) , 
 
                                         ( 0 ,   d 3 ,   d 2 ) , 
 
                                         f o r m a t t e r , 
 
                                 ) ? 
 
                         } 
 
                         i f   s h o w _ a l l   | |   s e l f . d a t a . l e n ( )   < =   F O R M A T E D _ E L E M E N T _ M A X _ C O U N T   { 
 
                                 f o r m a t t e r . w r i t e _ s t r ( " ] " ) 
 
                         }   e l s e   { 
 
                                 f o r m a t t e r . w r i t e _ s t r ( " ,   \ u { 2 0 2 6 } ] " ) 
 
                         } 
 
                 } 
 
         } 
 
         f n   f m t _ t e n s o r < V :   D e b u g > ( 
 
                 d 4 :   u s i z e , 
 
                 d 3 :   u s i z e , 
 
                 d 2 :   u s i z e , 
 
                 d a t a :   & V e c < V > , 
 
                 f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > , 
 
         )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                 l e t   s h o w _ a l l   =   f o r m a t t e r . a l t e r n a t e ( ) ; 
 
                 i f   s h o w _ a l l   { 
 
                         d i s p l a y ( d a t a . i t e r ( ) ,   ( d 4 ,   d 3 ,   d 2 ) ,   f o r m a t t e r ) ? 
 
                 }   e l s e   { 
 
                         d i s p l a y ( 
 
                                 d a t a . i t e r ( ) . t a k e ( F O R M A T E D _ E L E M E N T _ M A X _ C O U N T ) , 
 
                                 ( d 4 ,   d 3 ,   d 2 ) , 
 
                                 f o r m a t t e r , 
 
                         ) ? 
 
                 } 
 
                 i f   s h o w _ a l l   | |   d a t a . l e n ( )   < =   F O R M A T E D _ E L E M E N T _ M A X _ C O U N T   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ] " ) 
 
                 }   e l s e   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   \ u { 2 0 2 6 } ] " ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   D e b u g 
 
                 f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 2 ; 
 
                         l e t   d 4   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 3 ; 
 
                         f m t _ t e n s o r ( d 4 ,   d 3 ,   d 2 ,   & s e l f . d a t a ,   f o r m a t t e r ) 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   D e b u g 
 
                 f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 2 ; 
 
                         l e t   d 4   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 3 ; 
 
                         f m t _ t e n s o r ( d 4 ,   d 3 ,   d 2 ,   & s e l f . d a t a ,   f o r m a t t e r ) 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   D e b u g   f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 6 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 2 ; 
 
                         l e t   d 4   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 3 ; 
 
                         f m t _ t e n s o r ( d 4 ,   d 3 ,   d 2 ,   & s e l f . d a t a ,   f o r m a t t e r ) 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   D e b u g   f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 6 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 7 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 2 ; 
 
                         l e t   d 4   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 3 ; 
 
                         f m t _ t e n s o r ( d 4 ,   d 3 ,   d 2 ,   & s e l f . d a t a ,   f o r m a t t e r ) 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   D e b u g   f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 f n   f m t ( & s e l f ,   f o r m a t t e r :   & m u t   F o r m a t t e r < ' _ > )   - >   R e s u l t < ( ) ,   E r r o r >   { 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 8 } " ) ? ; 
 
                         s e l f . d 1 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 2 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 3 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 4 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 5 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 6 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 7 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " ,   " ) ? ; 
 
                         s e l f . d 8 . f m t ( f o r m a t t e r ) ? ; 
 
                         f o r m a t t e r . w r i t e _ s t r ( " \ u { 3 0 0 9 } [ " ) ? ; 
 
                         l e t   d 2   =   s e l f . d 2 . a s _ u s i z e ( ) ; 
 
                         l e t   d 3   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 2 ; 
 
                         l e t   d 4   =   s e l f . d 3 . a s _ u s i z e ( )   *   d 3 ; 
 
                         f m t _ t e n s o r ( d 4 ,   d 3 ,   d 2 ,   & s e l f . d a t a ,   f o r m a t t e r ) 
 
                 } 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   m a k e _ i n d e x _ 3 ( ( i 1 ,   i 2 ,   i 3 ) :   ( u s i z e ,   u s i z e ,   u s i z e ) ,   ( d 2 ,   d 3 ) :   ( u s i z e ,   u s i z e ) )   - >   u s i z e   { 
 
                 ( i 1   *   d 2   +   i 2 )   *   d 3   +   i 3 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   m a k e _ i n d e x _ 4 ( 
 
                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 ( d 2 ,   d 3 ,   d 4 ) :   ( u s i z e ,   u s i z e ,   u s i z e ) , 
 
         )   - >   u s i z e   { 
 
                 m a k e _ i n d e x _ 3 ( ( i 1 ,   i 2 ,   i 3 ) ,   ( d 2 ,   d 3 ) )   *   d 4   +   i 4 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   m a k e _ i n d e x _ 5 ( 
 
                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 ( d 2 ,   d 3 ,   d 4 ,   d 5 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
         )   - >   u s i z e   { 
 
                 m a k e _ i n d e x _ 4 ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ) ,   ( d 2 ,   d 3 ,   d 4 ) )   *   d 5   +   i 5 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   m a k e _ i n d e x _ 6 ( 
 
                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 ( d 2 ,   d 3 ,   d 4 ,   d 5 ,   d 6 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
         )   - >   u s i z e   { 
 
                 m a k e _ i n d e x _ 5 ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) ,   ( d 2 ,   d 3 ,   d 4 ,   d 5 ) )   *   d 6   +   i 6 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   m a k e _ i n d e x _ 7 ( 
 
                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 ( d 2 ,   d 3 ,   d 4 ,   d 5 ,   d 6 ,   d 7 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
         )   - >   u s i z e   { 
 
                 m a k e _ i n d e x _ 6 ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) ,   ( d 2 ,   d 3 ,   d 4 ,   d 5 ,   d 6 ) )   *   d 7   +   i 7 
 
         } 
 
         # [ i n l i n e ] 
 
         f n   m a k e _ i n d e x _ 8 ( 
 
                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 ( d 2 ,   d 3 ,   d 4 ,   d 5 ,   d 6 ,   d 7 ,   d 8 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
         )   - >   u s i z e   { 
 
                 m a k e _ i n d e x _ 7 ( ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) ,   ( d 2 ,   d 3 ,   d 4 ,   d 5 ,   d 6 ,   d 7 ) )   *   d 8   +   i 8 
 
         } 
 
         i m p l < V :   P a r t i a l E q   +   D e b u g >   I n d e x < ( ) >   f o r   T e n s o r 0 < V >   { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( & s e l f ,   _ i n d e x :   ( ) )   - >   & S e l f : : O u t p u t   { 
 
                         & s e l f . d a t a 
 
                 } 
 
         } 
 
         i m p l < V :   P a r t i a l E q   +   D e b u g >   I n d e x M u t < ( ) >   f o r   T e n s o r 0 < V >   { 
 
                 f n   i n d e x _ m u t ( & m u t   s e l f ,   _ i n d e x :   ( ) )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         & m u t   s e l f . d a t a 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   I n d e x < ( u s i z e , ) >   f o r   T e n s o r 1 < T ,   V >   { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( & s e l f ,   ( i 1 , ) :   ( u s i z e , ) )   - >   & S e l f : : O u t p u t   { 
 
                         & s e l f . d a t a [ i 1 ] 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   I n d e x M u t < ( u s i z e , ) >   f o r   T e n s o r 1 < T ,   V >   { 
 
                 f n   i n d e x _ m u t ( & m u t   s e l f ,   ( i 1 , ) :   ( u s i z e , ) )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         & m u t   s e l f . d a t a [ i 1 ] 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   I n d e x < ( u s i z e ,   u s i z e ) >   f o r   T e n s o r 2 < T 1 ,   T 2 ,   V >   { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( & s e l f ,   ( i 1 ,   i 2 ) :   ( u s i z e ,   u s i z e ) )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1   | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2   { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   i 1   *   s e l f . d 2 . a s _ u s i z e ( )   +   i 2 ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   I n d e x M u t < ( u s i z e ,   u s i z e ) >   f o r   T e n s o r 2 < T 1 ,   T 2 ,   V >   { 
 
                 f n   i n d e x _ m u t ( & m u t   s e l f ,   ( i 1 ,   i 2 ) :   ( u s i z e ,   u s i z e ) )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1   | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2   { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   i 1   *   s e l f . d 2 . a s _ u s i z e ( )   +   i 2 ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   I n d e x < ( u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > 
 
         { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( & s e l f ,   ( i 1 ,   i 2 ,   i 3 ) :   ( u s i z e ,   u s i z e ,   u s i z e ) )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1   | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2   | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3   { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 3 ( ( i 1 ,   i 2 ,   i 3 ) ,   ( s e l f . d 2 . a s _ u s i z e ( ) ,   s e l f . d 3 . a s _ u s i z e ( ) ) ) ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   I n d e x M u t < ( u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V > 
 
         { 
 
                 f n   i n d e x _ m u t ( & m u t   s e l f ,   ( i 1 ,   i 2 ,   i 3 ) :   ( u s i z e ,   u s i z e ,   u s i z e ) )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1   | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2   | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3   { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 3 ( ( i 1 ,   i 2 ,   i 3 ) ,   ( s e l f . d 2 . a s _ u s i z e ( ) ,   s e l f . d 3 . a s _ u s i z e ( ) ) ) ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 I n d e x < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) >   f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( & s e l f ,   ( i 1 ,   i 2 ,   i 3 ,   i 4 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 4 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ) , 
 
                                 ( s e l f . d 2 . a s _ u s i z e ( ) ,   s e l f . d 3 . a s _ u s i z e ( ) ,   s e l f . d 4 . a s _ u s i z e ( ) ) , 
 
                         ) ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 I n d e x M u t < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) >   f o r   T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 f n   i n d e x _ m u t ( 
 
                         & m u t   s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 4 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ) , 
 
                                 ( s e l f . d 2 . a s _ u s i z e ( ) ,   s e l f . d 3 . a s _ u s i z e ( ) ,   s e l f . d 4 . a s _ u s i z e ( ) ) , 
 
                         ) ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 I n d e x < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) >   f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( 
 
                         & s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 5 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 I n d e x M u t < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) >   f o r   T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 f n   i n d e x _ m u t ( 
 
                         & m u t   s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 5 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   I n d e x < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) >   f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( 
 
                         & s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                                 | |   s e l f . d 6 . a s _ u s i z e ( )   < =   i 6 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 6 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   I n d e x M u t < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 f n   i n d e x _ m u t ( 
 
                         & m u t   s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                                 | |   s e l f . d 6 . a s _ u s i z e ( )   < =   i 6 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 6 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   I n d e x < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( 
 
                         & s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                                 | |   s e l f . d 6 . a s _ u s i z e ( )   < =   i 6 
 
                                 | |   s e l f . d 7 . a s _ u s i z e ( )   < =   i 7 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 7 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 7 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   I n d e x M u t < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 f n   i n d e x _ m u t ( 
 
                         & m u t   s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) :   ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) , 
 
                 )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                                 | |   s e l f . d 6 . a s _ u s i z e ( )   < =   i 6 
 
                                 | |   s e l f . d 7 . a s _ u s i z e ( )   < =   i 7 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 7 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 7 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   I n d e x < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 t y p e   O u t p u t   =   V ; 
 
                 f n   i n d e x ( 
 
                         & s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) :   ( 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                         ) , 
 
                 )   - >   & S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                                 | |   s e l f . d 6 . a s _ u s i z e ( )   < =   i 6 
 
                                 | |   s e l f . d 7 . a s _ u s i z e ( )   < =   i 7 
 
                                 | |   s e l f . d 8 . a s _ u s i z e ( )   < =   i 8 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 8 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 7 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 8 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   & s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   I n d e x M u t < ( u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ,   u s i z e ) > 
 
                 f o r   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 f n   i n d e x _ m u t ( 
 
                         & m u t   s e l f , 
 
                         ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) :   ( 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                                 u s i z e , 
 
                         ) , 
 
                 )   - >   & m u t   S e l f : : O u t p u t   { 
 
                         i f   s e l f . d 1 . a s _ u s i z e ( )   < =   i 1 
 
                                 | |   s e l f . d 2 . a s _ u s i z e ( )   < =   i 2 
 
                                 | |   s e l f . d 3 . a s _ u s i z e ( )   < =   i 3 
 
                                 | |   s e l f . d 4 . a s _ u s i z e ( )   < =   i 4 
 
                                 | |   s e l f . d 5 . a s _ u s i z e ( )   < =   i 5 
 
                                 | |   s e l f . d 6 . a s _ u s i z e ( )   < =   i 6 
 
                                 | |   s e l f . d 7 . a s _ u s i z e ( )   < =   i 7 
 
                                 | |   s e l f . d 8 . a s _ u s i z e ( )   < =   i 8 
 
                         { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " I n v a l i d   i n d e x " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 8 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 7 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 8 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         u n s a f e   {   s e l f . d a t a . g e t _ u n c h e c k e d _ m u t ( i n d e x )   } 
 
                 } 
 
         } 
 
         i m p l < V :   P a r t i a l E q   +   D e b u g >   T e n s o r 0 < V >   { 
 
                 p u b   f n   n e w ( v a l u e :   V )   - >   S e l f   { 
 
                         T e n s o r 0 : : < V >   {   d a t a :   v a l u e   } 
 
                 } 
 
                 p u b   f n   g e t ( & s e l f )   - >   & V   { 
 
                         & s e l f . d a t a 
 
                 } 
 
         } 
 
         i m p l < T :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r 1 < T ,   V >   { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( & s e l f ,   i :   u s i z e )   - >   & V   { 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i ) 
 
                 } 
 
                 p u b   f n   f r o m _ v e c t o r _ w i t h _ d i m ( d :   D i m < T > ,   m u t   v a l u e s :   V e c < V > )   - >   S e l f   { 
 
                         i f   v a l u e s . l e n ( )   <   d . a s _ u s i z e ( )   { 
 
                                 : : c o r e : : p a n i c k i n g : : p a n i c _ f m t ( : : c o r e : : f m t : : A r g u m e n t s : : n e w _ v 1 ( 
 
                                         & [ " A r r a y   t o o   s h o r t " ] , 
 
                                         & [ ] , 
 
                                 ) ) 
 
                         } 
 
                         v a l u e s . t r u n c a t e ( d . a s _ u s i z e ( ) ) ; 
 
                         T e n s o r 1 : : < T ,   V >   { 
 
                                 p h a n t o m :   P h a n t o m D a t a   { } , 
 
                                 d a t a :   v a l u e s , 
 
                         } 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < D P r i m e :   D i m T a g > ( s e l f ,   d :   D i m < D P r i m e > )   - >   R e s u l t < T e n s o r 1 < D P r i m e ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d a t a . l e n ( )   = =   d . a s _ u s i z e ( )   { 
 
                                 O k ( T e n s o r 1 : : < D P r i m e ,   V >   { 
 
                                         p h a n t o m :   P h a n t o m D a t a   { } , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r 2 < T 1 ,   T 2 ,   V >   { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( & s e l f ,   i 1 :   u s i z e ,   i 2 :   u s i z e )   - >   & V   { 
 
                         l e t   i n d e x   =   i 1   *   s e l f . d 2 . a s _ u s i z e ( )   +   i 2 ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < E 1 :   D i m T a g ,   E 2 :   D i m T a g > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                 )   - >   R e s u l t < T e n s o r 2 < E 1 ,   E 2 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1   & &   s e l f . d 2   = =   d 2   { 
 
                                 O k ( T e n s o r 2 : : < E 1 ,   E 2 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g >   T e n s o r 3 < T 1 ,   T 2 ,   T 3 ,   V >   { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( & s e l f ,   i 1 :   u s i z e ,   i 2 :   u s i z e ,   i 3 :   u s i z e )   - >   & V   { 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 3 ( ( i 1 ,   i 2 ,   i 3 ) ,   ( s e l f . d 2 . a s _ u s i z e ( ) ,   s e l f . d 3 . a s _ u s i z e ( ) ) ) ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < E 1 :   D i m T a g ,   E 2 :   D i m T a g ,   E 3 :   D i m T a g > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                         d 3 :   D i m < E 3 > , 
 
                 )   - >   R e s u l t < T e n s o r 3 < E 1 ,   E 2 ,   E 3 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1   & &   s e l f . d 2   = =   d 2   & &   s e l f . d 3   = =   d 3   { 
 
                                 O k ( T e n s o r 3 : : < E 1 ,   E 2 ,   E 3 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d 3 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 T e n s o r 4 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   V > 
 
         { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( & s e l f ,   i 1 :   u s i z e ,   i 2 :   u s i z e ,   i 3 :   u s i z e ,   i 4 :   u s i z e )   - >   & V   { 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 4 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ) , 
 
                                 ( s e l f . d 2 . a s _ u s i z e ( ) ,   s e l f . d 3 . a s _ u s i z e ( ) ,   s e l f . d 4 . a s _ u s i z e ( ) ) , 
 
                         ) ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < E 1 :   D i m T a g ,   E 2 :   D i m T a g ,   E 3 :   D i m T a g ,   E 4 :   D i m T a g > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                         d 3 :   D i m < E 3 > , 
 
                         d 4 :   D i m < E 4 > , 
 
                 )   - >   R e s u l t < T e n s o r 4 < E 1 ,   E 2 ,   E 3 ,   E 4 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1   & &   s e l f . d 2   = =   d 2   & &   s e l f . d 3   = =   d 3   & &   s e l f . d 4   = =   d 4   { 
 
                                 O k ( T e n s o r 4 : : < E 1 ,   E 2 ,   E 3 ,   E 4 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d 3 , 
 
                                         d 4 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < T 1 :   D i m T a g ,   T 2 :   D i m T a g ,   T 3 :   D i m T a g ,   T 4 :   D i m T a g ,   T 5 :   D i m T a g ,   V :   P a r t i a l E q   +   D e b u g > 
 
                 T e n s o r 5 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   V > 
 
         { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( 
 
                         & s e l f , 
 
                         i 1 :   u s i z e , 
 
                         i 2 :   u s i z e , 
 
                         i 3 :   u s i z e , 
 
                         i 4 :   u s i z e , 
 
                         i 5 :   u s i z e , 
 
                 )   - >   & V   { 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 5 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < E 1 :   D i m T a g ,   E 2 :   D i m T a g ,   E 3 :   D i m T a g ,   E 4 :   D i m T a g ,   E 5 :   D i m T a g > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                         d 3 :   D i m < E 3 > , 
 
                         d 4 :   D i m < E 4 > , 
 
                         d 5 :   D i m < E 5 > , 
 
                 )   - >   R e s u l t < T e n s o r 5 < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1   & &   s e l f . d 2   = =   d 2   & &   s e l f . d 3   = =   d 3   & &   s e l f . d 4   = =   d 4   & &   s e l f . d 5   = =   d 5   { 
 
                                 O k ( T e n s o r 5 : : < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d 3 , 
 
                                         d 4 , 
 
                                         d 5 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   T e n s o r 6 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   V > 
 
         { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( 
 
                         & s e l f , 
 
                         i 1 :   u s i z e , 
 
                         i 2 :   u s i z e , 
 
                         i 3 :   u s i z e , 
 
                         i 4 :   u s i z e , 
 
                         i 5 :   u s i z e , 
 
                         i 6 :   u s i z e , 
 
                 )   - >   & V   { 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 6 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < E 1 :   D i m T a g ,   E 2 :   D i m T a g ,   E 3 :   D i m T a g ,   E 4 :   D i m T a g ,   E 5 :   D i m T a g ,   E 6 :   D i m T a g > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                         d 3 :   D i m < E 3 > , 
 
                         d 4 :   D i m < E 4 > , 
 
                         d 5 :   D i m < E 5 > , 
 
                         d 6 :   D i m < E 6 > , 
 
                 )   - >   R e s u l t < T e n s o r 6 < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   E 6 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1 
 
                                 & &   s e l f . d 2   = =   d 2 
 
                                 & &   s e l f . d 3   = =   d 3 
 
                                 & &   s e l f . d 4   = =   d 4 
 
                                 & &   s e l f . d 5   = =   d 5 
 
                                 & &   s e l f . d 6   = =   d 6 
 
                         { 
 
                                 O k ( T e n s o r 6 : : < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   E 6 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d 3 , 
 
                                         d 4 , 
 
                                         d 5 , 
 
                                         d 6 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   T e n s o r 7 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   V > 
 
         { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( 
 
                         & s e l f , 
 
                         i 1 :   u s i z e , 
 
                         i 2 :   u s i z e , 
 
                         i 3 :   u s i z e , 
 
                         i 4 :   u s i z e , 
 
                         i 5 :   u s i z e , 
 
                         i 6 :   u s i z e , 
 
                         i 7 :   u s i z e , 
 
                 )   - >   & V   { 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 7 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 7 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < 
 
                         E 1 :   D i m T a g , 
 
                         E 2 :   D i m T a g , 
 
                         E 3 :   D i m T a g , 
 
                         E 4 :   D i m T a g , 
 
                         E 5 :   D i m T a g , 
 
                         E 6 :   D i m T a g , 
 
                         E 7 :   D i m T a g , 
 
                 > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                         d 3 :   D i m < E 3 > , 
 
                         d 4 :   D i m < E 4 > , 
 
                         d 5 :   D i m < E 5 > , 
 
                         d 6 :   D i m < E 6 > , 
 
                         d 7 :   D i m < E 7 > , 
 
                 )   - >   R e s u l t < T e n s o r 7 < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   E 6 ,   E 7 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1 
 
                                 & &   s e l f . d 2   = =   d 2 
 
                                 & &   s e l f . d 3   = =   d 3 
 
                                 & &   s e l f . d 4   = =   d 4 
 
                                 & &   s e l f . d 5   = =   d 5 
 
                                 & &   s e l f . d 6   = =   d 6 
 
                                 & &   s e l f . d 7   = =   d 7 
 
                         { 
 
                                 O k ( T e n s o r 7 : : < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   E 6 ,   E 7 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d 3 , 
 
                                         d 4 , 
 
                                         d 5 , 
 
                                         d 6 , 
 
                                         d 7 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
         i m p l < 
 
                         T 1 :   D i m T a g , 
 
                         T 2 :   D i m T a g , 
 
                         T 3 :   D i m T a g , 
 
                         T 4 :   D i m T a g , 
 
                         T 5 :   D i m T a g , 
 
                         T 6 :   D i m T a g , 
 
                         T 7 :   D i m T a g , 
 
                         T 8 :   D i m T a g , 
 
                         V :   P a r t i a l E q   +   D e b u g , 
 
                 >   T e n s o r 8 < T 1 ,   T 2 ,   T 3 ,   T 4 ,   T 5 ,   T 6 ,   T 7 ,   T 8 ,   V > 
 
         { 
 
                 p u b   u n s a f e   f n   g e t _ u n c h e c k e d ( 
 
                         & s e l f , 
 
                         i 1 :   u s i z e , 
 
                         i 2 :   u s i z e , 
 
                         i 3 :   u s i z e , 
 
                         i 4 :   u s i z e , 
 
                         i 5 :   u s i z e , 
 
                         i 6 :   u s i z e , 
 
                         i 7 :   u s i z e , 
 
                         i 8 :   u s i z e , 
 
                 )   - >   & V   { 
 
                         l e t   i n d e x   =   m a k e _ i n d e x _ 8 ( 
 
                                 ( i 1 ,   i 2 ,   i 3 ,   i 4 ,   i 5 ,   i 6 ,   i 7 ,   i 8 ) , 
 
                                 ( 
 
                                         s e l f . d 2 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 3 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 4 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 5 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 6 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 7 . a s _ u s i z e ( ) , 
 
                                         s e l f . d 8 . a s _ u s i z e ( ) , 
 
                                 ) , 
 
                         ) ; 
 
                         s e l f . d a t a . g e t _ u n c h e c k e d ( i n d e x ) 
 
                 } 
 
                 p u b   f n   t r y _ c a s t < 
 
                         E 1 :   D i m T a g , 
 
                         E 2 :   D i m T a g , 
 
                         E 3 :   D i m T a g , 
 
                         E 4 :   D i m T a g , 
 
                         E 5 :   D i m T a g , 
 
                         E 6 :   D i m T a g , 
 
                         E 7 :   D i m T a g , 
 
                         E 8 :   D i m T a g , 
 
                 > ( 
 
                         s e l f , 
 
                         d 1 :   D i m < E 1 > , 
 
                         d 2 :   D i m < E 2 > , 
 
                         d 3 :   D i m < E 3 > , 
 
                         d 4 :   D i m < E 4 > , 
 
                         d 5 :   D i m < E 5 > , 
 
                         d 6 :   D i m < E 6 > , 
 
                         d 7 :   D i m < E 7 > , 
 
                         d 8 :   D i m < E 8 > , 
 
                 )   - >   R e s u l t < T e n s o r 8 < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   E 6 ,   E 7 ,   E 8 ,   V > ,   S e l f >   { 
 
                         i f   s e l f . d 1   = =   d 1 
 
                                 & &   s e l f . d 2   = =   d 2 
 
                                 & &   s e l f . d 3   = =   d 3 
 
                                 & &   s e l f . d 4   = =   d 4 
 
                                 & &   s e l f . d 5   = =   d 5 
 
                                 & &   s e l f . d 6   = =   d 6 
 
                                 & &   s e l f . d 7   = =   d 7 
 
                                 & &   s e l f . d 8   = =   d 8 
 
                         { 
 
                                 O k ( T e n s o r 8 : : < E 1 ,   E 2 ,   E 3 ,   E 4 ,   E 5 ,   E 6 ,   E 7 ,   E 8 ,   V >   { 
 
                                         d 1 , 
 
                                         d 2 , 
 
                                         d 3 , 
 
                                         d 4 , 
 
                                         d 5 , 
 
                                         d 6 , 
 
                                         d 7 , 
 
                                         d 8 , 
 
                                         d a t a :   s e l f . d a t a , 
 
                                 } ) 
 
                         }   e l s e   { 
 
                                 E r r ( s e l f ) 
 
                         } 
 
                 } 
 
         } 
 
 } 
 
 