Bug on "_get_feature" function from xgboost_cost_model.py

env:

macOS
arm cpu
tvm latest version

I run auto-tuning code, the following error has occurred:

 tune_tasks(tasks, **tuning_option)
  File "mobile.py", line 163, in tune_tasks
    autotvm.callback.log_to_file(tmp_log_file)
  File "/tvm/python/tvm/autotvm/tuner/xgboost_tuner.py", line 90, in tune
    super(XGBTuner, self).tune(*args, **kwargs)
  File "/tvm/python/tvm/autotvm/tuner/tuner.py", line 156, in tune
    self.update(inputs, results)
  File "/tvm/python/tvm/autotvm/tuner/model_based_tuner.py", line 266, in update
    self.cost_model.fit(self.xs, self.ys, self.plan_size)
  File "/tvm/python/tvm/autotvm/tuner/xgboost_cost_model.py", line 181, in fit
    x_train = self._get_feature(xs)
  File "/tvm/python/tvm/autotvm/tuner/xgboost_cost_model.py", line 329, in _get_feature
    ret[i, :] = t if t is not None else 0
ValueError: could not broadcast input array from shape (1009) into shape (871)

error_code

I find a problem by printing:

The each line of fea_cache has a different length:
0 (871,)
1 (1009,)
2 (1057,)
3 (1009,)
4 (871,)
5 (1009,)
6 (871,)
...

But the feature_len is equal to the first row length of fea_cahe and “ret = np.empty((len(indexes), feature_len), dtype=np.float32)”.

so when running "ret[i, :] = fea_cache[ii]", the error has occurred:
”ValueError: could not broadcast input array from shape (1009) into shape (871)“

Even i have same issue

ValueError: could not broadcast input array from shape (871) into shape (1009)

I guess, found the issue it because if have different data layout it gives this issue but before auto tvm if you do the transformation, there is no problem

transform to NCHW layout!!