microsoft / microsoft/FLAML

TypeError: unsupported operand type(s) for <<: 'int' and 'Integer'

Open
#957 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
4.4k
Forks
565
Avg merge
5d 8m
Merged PRs (30d)
17

Description

Hello,

I'm encountering an error when running the following code on Windows using Python 3.10 with the latest version of the library:

```python
def config2params(self, config: dict) -> dict:
params = super().config2params(config)
if "log_max_bin" in params:
params["max_bin"] = (1 << params.pop("log_max_bin")) - 1
return params
```

The error I'm encountering is: "TypeError: unsupported operand type(s) for <<: 'int' and 'Integer'" and it occurs on the following line:

```python
1006 │ params["max_bin"] = (1 << params.pop("log_max_bin")) - 1
```

It seems that `log_max_bin` is not an **int**, but rather a **flaml.tune.sample.Integer**, and even after trying to convert it to int(), it still doesn't work.

I would greatly appreciate any suggestions on how to fix this issue.

Thank you!

Best regards,
Andrej

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.