google-research / google-research/optformer

to_str() raises TypeError due to float input in np.base_repr()

Open
#153 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
244
Forks
36
Avg merge
9h 41m
Merged PRs (30d)
2

Description

### Description:
I encountered a TypeError when calling to_str(f: float). The issue occurs because np.base_repr() expects an integer, but the function passes a floating-point number.

### Steps to Reproduce:
```
serializer = NumericSerializer()
print(serializer.to_str(2.5)) # Raises TypeError
```

### Error Message:
TypeError: string indices must be integers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.