You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/08/19 17:44:15 UTC

[GitHub] [incubator-tvm] interesaaat commented on issue #6300: [Frontend][PyTorch] Cast to Long gets translated into cast to float32

interesaaat commented on issue #6300:
URL: https://github.com/apache/incubator-tvm/issues/6300#issuecomment-676567592


   Thanks @masahi for the super quick PR! However the problem still persist. I think there is something else going on because now it casts to long and then to float 32 afterwards!
   
   ```
     %0 = (%v_operator_map.SklearnLGBMRegressor.nodes_offset, %v_operator_map.SklearnLGBMRegressor.nodes_offset, %v_operator_map.SklearnLGBMRegressor.nodes_offset);
     %1 = concatenate(%0);
     %2 = reshape(%1, newshape=[-1]);
     %3 = take(%v_operator_map.SklearnLGBMRegressor.features, %2, axis=0);
     %4 = reshape(%3, newshape=[-1, 3]);
     %5 = gather(%input, %4, axis=1);
     %6 = take(%v_operator_map.SklearnLGBMRegressor.thresholds, %2, axis=0);
     %7 = reshape(%6, newshape=[-1, 3]);
     %8 = greater_equal(%5, %7);
     %9 = take(%v_operator_map.SklearnLGBMRegressor.rights, %2, axis=0);
     %10 = reshape(%9, newshape=[-1, 3]);
     %11 = take(%v_operator_map.SklearnLGBMRegressor.lefts, %2, axis=0);
     %12 = reshape(%11, newshape=[-1, 3]);
     %13 = where(%8, %10, %12);
     %14 = cast(%13, dtype="int64");
     %15 = cast(%14, dtype="float32");
     %16 = add(%15, %v_operator_map.SklearnLGBMRegressor.nodes_offset) an internal invariant was violated while typechecking your program [10:41:33] /Users/mainterl/Develop/tvm/src/relay/op/type_relations.cc:107: Check failed: t0->dtype == t1->dtype (float32 vs. int64) : 
   ```
   Perhaps the add only works over floats and is forcing a cast? No idea..


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org