Neat Python trick objects than implement buffor protocol are internally implemented as C arrays so we can abuse memoryview to cast multidimensional arrays into flat ones like that without making copies: “memoryview(matrix).cast('B').cast('d')” Thanks to Jerry Gamashe and Frieder Erdman from AWSF slack to help figure this! #python #vfx #techart
I like trains
Clever, though it depends on memory layout assumptions i would normally consider as unsafe.