tensorflow/core/platform:ctstring_test fails on Big endian system

19 views
Skip to first unread message

siddesh sangodkar

unread,
Apr 25, 2022, 10:33:36 AMApr 25
to TensorFlow Developers
Hi 
this is regarding TEST(TF_CTStringTest, OffsetType) added recently (
https://github.com/tensorflow/tensorflow/commit/3712a2d3455e6ccb924daa5724a3652a86f6b585)

test is failing on Big endian systems
expected results for  TF_TString_GetSize(&s71) is 8 while on big endian returns 0.

found a possible root cause  for this, (https://github.com/tensorflow/tensorflow/blob/3f878cff5b698b82eea85db2b60d65a2e320850e/tensorflow/core/platform/ctstring_test.cc#L397) returns different values on little endian vs Big endian
    s71.u.offset.size = TF_TString_ToInternalSizeT(size, TF_TSTR_OFFSET);


for size= 8,  TF_TSTR_OFFSET=2 
on Intel (x86) value of this function TF_TString_ToInternalSizeT is "34"  
while on S390x (Big endian) is "14411518807585588" (in Hex is  33 3333 3333 3334)

wanted to know if  calculation here is correct  https://github.com/tensorflow/tensorflow/blob/3f878cff5b698b82eea85db2b60d65a2e320850e/tensorflow/core/platform/ctstring_internal.h#L158


Reply all
Reply to author
Forward
0 new messages