interesaaat edited a comment on issue #6300:
URL: https://github.com/apache/incubator-tvm/issues/6300#issuecomment-676780260
This is the log if I remove the explicit cast.
```
In `main`:
#[version = "0.0.5"]
fn (%v_operator_map.SklearnLGBMRegressor.values: Tensor[(15, 1), float32],
%input: Tensor[(3, 2), float32], %v_operator_map.SklearnLGBMRegressor.features:
Tensor[(15), int64], %v_operator_map.SklearnLGBMRegressor.nodes_offset:
Tensor[(1, 3), int64], %v_operator_map.SklearnLGBMRegressor.thresholds:
Tensor[(15), float32], %v_operator_map.SklearnLGBMRegressor.rights:
Tensor[(15), int64], %v_operator_map.SklearnLGBMRegressor.lefts: Tensor[(15),
int64]) {
%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 [15:30:33]
/Develop/tvm/src/relay/op/type_relations.cc:107: Check failed: t0->dtype ==
t1->dtype (float32 vs. int64) :
; ;
%17 = reshape(%16, newshape=[-1]);
%18 = take(%v_operator_map.SklearnLGBMRegressor.features, %17, axis=0);
%19 = reshape(%18, newshape=[-1, 3]);
%20 = gather(%input, %19, axis=1);
%21 = take(%v_operator_map.SklearnLGBMRegressor.thresholds, %17, axis=0);
%22 = reshape(%21, newshape=[-1, 3]);
%23 = greater_equal(%20, %22);
%24 = take(%v_operator_map.SklearnLGBMRegressor.rights, %17, axis=0);
%25 = reshape(%24, newshape=[-1, 3]);
%26 = take(%v_operator_map.SklearnLGBMRegressor.lefts, %17, axis=0);
%27 = reshape(%26, newshape=[-1, 3]);
%28 = where(%23, %25, %27) an internal invariant was violated while
typechecking your program [15:30:33]
/Develop/tvm/src/relay/op/tensor/transform.cc:1646: Check failed: condition !=
nullptr && x != nullptr && y != nullptr:
; ;
%29 = cast(%28, dtype="int64");
%30 = cast(%29, dtype="float32");
%31 = add(%30, %v_operator_map.SklearnLGBMRegressor.nodes_offset);
%32 = reshape(%31, newshape=[-1]);
%33 = take(%v_operator_map.SklearnLGBMRegressor.values, %32, axis=0);
%34 = reshape(%33, newshape=[-1, 3, 1]);
%35 = reshape(%34, newshape=[-1, 1, 3]);
sum(%35, axis=[2])
}
```
----------------------------------------------------------------
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:
[email protected]