@@ -697,6 +697,22 @@ export const RUNTIME_CATALOGUE: readonly CatalogueRow[] = [
697697 value : { data : [ 1 , - 2 ] , shape : [ 2 ] , dtype : 'torch.int64' , device : 'cpu' } ,
698698 } ,
699699 } ) ,
700+ ...( [ 'float64' , 'int8' , 'int16' , 'int32' , 'uint8' ] as const ) . map ( dtype => {
701+ const data = dtype === 'uint8' ? [ 0 , 3 , 255 ] : dtype . startsWith ( 'int' ) ? [ 1 , - 2 ] : [ 1.5 , - 2.25 ] ;
702+ return libraryRow ( {
703+ id : `torch-${ dtype } ` ,
704+ call : `torch_dtype('${ dtype } ')` ,
705+ functionName : 'torch_dtype' ,
706+ args : [ dtype ] ,
707+ requires : [ 'torch' , 'pyarrow' ] ,
708+ status : 'EXPECTED_OK' ,
709+ currentBehavior : `A dense ${ dtype } CPU tensor round-trips with its declared dtype.` ,
710+ expected : {
711+ kind : 'match' ,
712+ value : { data, shape : [ data . length ] , dtype : `torch.${ dtype } ` , device : 'cpu' } ,
713+ } ,
714+ } ) ;
715+ } ) ,
700716 libraryRow ( {
701717 id : 'torch-scalar' ,
702718 call : 'torch_scalar()' ,
@@ -712,17 +728,26 @@ export const RUNTIME_CATALOGUE: readonly CatalogueRow[] = [
712728 id : 'torch-bfloat16' ,
713729 call : 'torch_bfloat16()' ,
714730 requires : [ 'torch' , 'pyarrow' ] ,
715- status : 'LOUD_FAIL' ,
716- currentBehavior : 'NumPy conversion rejects bfloat16.' ,
717- expected : error ( / F a i l e d t o c o n v e r t t o r c h \. T e n s o r t o n u m p y / i) ,
731+ status : 'EXPECTED_OK' ,
732+ currentBehavior : 'bfloat16 values upcast exactly to float32 and retain their source dtype.' ,
733+ expected : {
734+ kind : 'match' ,
735+ value : {
736+ data : [ 1 , - 2.5 , 3.140625 , 2 ** 16 , 2 ** 32 ] ,
737+ shape : [ 5 ] ,
738+ dtype : 'torch.float32' ,
739+ sourceDtype : 'torch.bfloat16' ,
740+ device : 'cpu' ,
741+ } ,
742+ } ,
718743 } ) ,
719744 libraryRow ( {
720745 id : 'torch-sparse' ,
721746 call : 'torch_sparse()' ,
722747 requires : [ 'torch' ] ,
723748 status : 'LOUD_FAIL' ,
724749 currentBehavior : 'Sparse tensor layouts are rejected explicitly.' ,
725- expected : error ( / s p a r s e t e n s o r s a r e n o t s u p p o r t e d / i) ,
750+ expected : error ( / c o n v e r t t o a d e n s e C P U t e n s o r e x p l i c i t l y . * t e n s o r \. t o _ d e n s e / i) ,
726751 } ) ,
727752 libraryRow ( {
728753 id : 'torch-quantized' ,
@@ -731,15 +756,23 @@ export const RUNTIME_CATALOGUE: readonly CatalogueRow[] = [
731756 featureProbe : 'import torch; print("1" if hasattr(torch, "quantize_per_tensor") else "0")' ,
732757 status : 'LOUD_FAIL' ,
733758 currentBehavior : 'Quantized tensors are rejected explicitly.' ,
734- expected : error ( / q u a n t i z e d t e n s o r s a r e n o t s u p p o r t e d / i) ,
759+ expected : error ( / d e q u a n t i z e e x p l i c i t l y .* t e n s o r \. d e q u a n t i z e / i) ,
760+ } ) ,
761+ libraryRow ( {
762+ id : 'torch-meta' ,
763+ call : 'torch_meta()' ,
764+ requires : [ 'torch' ] ,
765+ status : 'LOUD_FAIL' ,
766+ currentBehavior : 'Meta tensors are rejected explicitly.' ,
767+ expected : error ( / m a t e r i a l i z e t h e t e n s o r o n a r e a l d e v i c e b e f o r e r e t u r n i n g / i) ,
735768 } ) ,
736769 libraryRow ( {
737770 id : 'torch-complex' ,
738771 call : 'torch_complex()' ,
739772 requires : [ 'torch' ] ,
740773 status : 'LOUD_FAIL' ,
741774 currentBehavior : 'Complex tensors are rejected explicitly.' ,
742- expected : error ( / c o m p l e x t e n s o r s a r e n o t s u p p o r t e d / i) ,
775+ expected : error ( / s p l i t i n t o r e a l \/ i m a g c o m p o n e n t s e x p l i c i t l y b e f o r e r e t u r n i n g / i) ,
743776 } ) ,
744777
745778 libraryRow ( {
0 commit comments