It's an interesting finding. Could you elaborate a case that `__repr__` is 
invoked before config collection?

On the other hand, your suggested change will make the caching useless, because 
`ConfigSpace._collect` is always true. A more safer solution could be like:

```python
def _add_new_transform(self, space_class, name, axes, policy, **kwargs):
    self._length = None
    # do the rest process.
```

In this way, we "invalid" any existing length when a new knob is added.

Another solution is maintaining the length on the fly:

```python
def __init__(self):
      self._length = 1

def _add_new_transform(self, space_class, name, axes, policy, **kwargs):
      # do the rest process.
     self._length *= len(self._entity_map[name])

def __len__(self):
    return self._length
```





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/small-config-bug-in-autotvm/8285/2) to 
respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/51bca63435f8778ee2ed367a2f783950ad4c783935985c625aa4b3b582464b93).

Reply via email to