+
    nDj                        ^ RI t ^ RIt^ RIt^ RIt^ RIt ^ RIt^ RI
tR]P                  ! 4       3R]P                  ! 4       3R]P                  ! 4       3R]P                  ! 4       3R]P                   ! 4       3R]P"                  ! 4       3R]P$                  ! 4       3R	]P&                  ! 4       3R
]P(                  ! 4       3R]P*                  ! 4       3R]P,                  ! 4       3.tR tR t]P                  P5                  R]4      R 4       tR t]P                  P:                  R 4       tR tR t R t!R t"R t#R t$R#   ] d    ]P                  P
                  t	 ELGi ; i)    Ni1i2i4i8u1u2u4u8f2f4f8c                     \         P                  P                  ^
^4      p \        P                  P                  V 4      pVP                  ^8X  g   Q hVP                  . 8X  g   Q hVP                  ^(8X  g   Q hVP                  V P                  8X  g   Q hVP                  V P                  8X  g   Q hVP                  '       g   Q hVP                  '       g   Q hV P                  4       pRVP                  n        \        P                  P                  V4      pVP                  '       d   Q h\        P                  P                  V RR7      pVP                  ^8X  g   Q hVP                  RR.8X  g   Q hVP!                  ^ 4      R8X  g   Q hVP!                  ^4      R8X  g   Q h\"        P$                  ! V4      pV! 4       f   Q h?V! 4       e   Q hR# )
   Fxy)	dim_namesN)r   r   )nprandomrandnpaTensor
from_numpyndimr   sizeshapestridesis_contiguous
is_mutablecopyflags	writeabledim_nameweakrefref)datatensordata2wrs       S/data/cameron/venvs/s3viz/lib/python3.14/site-packages/pyarrow/tests/test_tensor.pytest_tensor_attrsr*   .   s   99??2q!DYY!!$'F;;!r!!!;;"<<4::%%%>>T\\))) IIKE!EKKYY!!%(F      YY!!$*!=F;;!Sz)))??1$$$??1$$$	V	B44<<    c                     \         P                  P                  \        P                  P                  ^
^4      4      p \        P                  ! V 4      pV P                  4       p\        P                  ! V 4      V^,           8X  g   Q hR# r   N)	r   r   r   r   r   r   sysgetrefcountto_numpy)r&   narrays      r)   test_tensor_base_objectr3   O   sZ    YY!!"))//"a"89FAOOE??6"a!e+++r+   zdtype_str,arrow_typec                 
   \         P                  ! V 4      p\        P                  ! 4       ;_uu_ 4        \        P                  ! R 4       ^d\         P
                  P                  ^
^4      ,          P                  V4      pRRR4       \        P                  P                  X4      pVP                  V8X  g   Q h\        V4       VP                  4       pW58H  P                  4       '       g   Q hR#   + '       g   i     Ly; i)ignoreN)r   dtypewarningscatch_warningssimplefilterr   r   astyper   r   r   typereprr0   all)	dtype_str
arrow_typer6   r%   r&   results   &&    r)   test_tensor_numpy_roundtriprA   V   s    HHYE		 	 	"	"h'biioob!,,44U; 
# YY!!$'F;;*$$$L__FN!!!! 
#	"s   AC22D	c                    \         P                  P                  ^
^4      p\        P                  P                  V4      p\        P                  P                  \        V 4      R4      p\        P                  ! VR4      p\        P                  P                  W$4       VP                  ^ 4       \        P                  P                  V4      pVP                  V4      '       g   Q hR# )r   zpyarrow-tensor-ipc-roundtripi   N)r   r   r   r   r   r   ospathjoinstrcreate_memory_mapipcwrite_tensorseekread_tensorequals)tmpdirr%   r&   rD   mmapr@   s   &     r)   test_tensor_ipc_roundtriprO   f   s    99??2q!DYY!!$'F77<<F%CDDd+DFF%IIaLVV%F==    r+   c                    \         P                  P                  ^
^4      p\        P                  P                  V4      pV R,          p\        P                  ! VRR7      p\        P                  P                  W$4       VP                  4        \        P                  P                  \        P                  ! VRR7      4      pVP                  V4      '       g   Q hR# )r   ztensor-compressed-filegzip)compressionN)r   r   r   r   r   r   output_streamrH   rI   closerK   input_streamrL   )tempdirr%   r&   rD   
out_streamr@   s   &     r)   $test_tensor_ipc_read_from_compressedrX   u   s     99??2q!DYY!!$'F--D!!$F;JFF+VV& IJF==    r+   c                    \         P                  P                  ^
^4      p\        P                  P                  VR,          4      p\         P                  P                  ^
^^4      p\        P                  P                  VR,          4      p\        P                  P                  \        V 4      R4      p\        P                  ! VR4      pW$3 F|  pVP                  ^ 4       \        P                  P                  Wv4       VP                  ^ 4       \        P                  P                  V4      pVP                  V4      '       d   K|  Q h	  R# )r   NN   zpyarrow-tensor-ipc-stridedi   NNNNrZ   r]   )r   r   r   r   r   r   rC   rD   rE   rF   rG   rJ   rH   rI   rK   rL   )	rM   data1tensor1r'   tensor2rD   rN   r&   r@   s	   &        r)   test_tensor_ipc_stridedra      s    IIOOB"Eii""5:.GIIOOB1%Eii""5#56G77<<F%ABDd+D$		!
F)		!##D)}}V$$$$ %r+   c                     R  p R p\         P                  P                  ^
^^4      R,          p\        P                  P                  V4      p\        P                  P                  \         P                  ! V4      4      pV ! W44       VP                  4       pRVR&   \        P                  P                  \         P                  ! V4      4      pV! W44       R# )c                 X    V P                  V4      '       g   Q hW8X  g   Q hW8w  d   Q hR # NrL   abs   &&r)   eqtest_tensor_equals.<locals>.eq   s)    xx{{{vvF|Fr+   c                 X    V P                  V4      '       d   Q hW8X  d   Q hW8w  g   Q hR # rd   re   rf   s   &&r)   netest_tensor_equals.<locals>.ne   s'    88A;;F|vvr+   g      ?Nr\   )	   r   r   )r   r   r   r   r   r   ascontiguousarrayr   )ri   rl   r%   r_   r`   s        r)   test_tensor_equalsrp      s    

 99??2q!$[1Dii""4(Gii""2#7#7#=>Gw99;DDMii""2#7#7#=>Gwr+   c            	          \         P                  ! \        R R7      ;_uu_ 4        \        \        P
                  P                  \        P                  ! ^
4      4      4       RRR4       R#   + '       g   i     R# ; i)
unhashable)matchN)	pytestraises	TypeErrorhashr   r   r   r   arange r+   r)   test_tensor_hashingrz      sA    	y	5	5RYY!!"))B-01 
6	5	5	5s   =A,,A=	c                      \         P                  P                  ^
^4      p \        P                  P                  V 4      p\        P                  P                  V4      V P                  ^,          8  g   Q hR# r-   )	r   r   r   r   r   r   rH   get_tensor_sizer   )r%   r&   s     r)   test_tensor_sizer}      sO    99??2q!DYY!!$'F66!!&)TYY];;;r+   c                    \         P                  P                  ^
^4      p\        P                  P                  V4      p\        P                  P                  V4      p\        P                  P                  \        V 4      R4      p\        P                  ! WC4      p\        P                  P                  W%4       \        P                  R8X  d   VP!                  4        \        P"                  ! VRR7      p\        P                  P%                  V4      P'                  4       p\         P(                  P+                  W4       R# )r   zpyarrow-tensor-ipc-read-tensor
emscriptenr)modeN)r   r   r   r   r   r   rH   r|   rC   rD   rE   rF   rG   rI   r.   platformrT   
memory_maprK   r0   testingassert_equal)rM   r%   r&   	data_sizerD   
write_mmap	read_mmapr2   s   &       r)   test_read_tensorr      s    99??2q!DYY!!$'F&&v.I77<<F%EFD%%d6JFF+
|||# 	d-IFFy)224EJJD(r+   c                     \         P                  R 3\         P                  R3\         P                  R3\         P                  R3\         P
                  R33 EF  w  r\         P                  ! ^
V R7      pVP                  p VP                  4       p\        P                  P                  V4      p\        V4      pVP                  V8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                   ^8X  g   Q hVP"                  VP"                  8X  g   Q hVP$                  VP$                  8X  g   Q hVP$                  ^,          VP&                  P(                  8X  g   Q h\         P*                  ! WP4      P                  4       V8X  g   Q h??\         P*                  ! WP4      P                  4       V8X  d   EK  Q h	  R# )z=bz=qz=Qed)r6   N)r   int8int64uint64float16float64rx   r6   tolistr   r   r   
memoryviewformatr   r   r   nbytesitemsizer;   	bit_width
frombuffer)r6   expected_formatr%   lstr&   ms         r)   test_tensor_memoryviewr      so   $&GGT?$&HHd#3$&IIt#4$&JJ#4$&JJ#4	#% yy5)

kkm%%d+vxx?***ww$**$$$yyDLL(((vv{{xx4;;&&&zzT]]***zzA~!6!6666}}Q&--/3666D}}Q&--/3666)#%r+   )%rC   r.   rt   r7   r#   numpyr   ImportErrormark
pytestmarkpyarrowr   r   int16int32r   uint8uint16uint32r   r   float32r   tensor_type_pairsr*   r3   parametrizerA   rO   rQ   rX   ra   rp   rz   r}   r   r   ry   r+   r)   <module>r      s\  $ 
 
   #  
2779	288:	288:	288:	288:	299;	299;	299;	2::<	2::<	2::< B, /1BC" D"! ! !%(*2<)$7e  #""J#s   E E"!E"