greentfrapp / lucent

Lucid library adapted for PyTorch
Apache License 2.0
597 stars 89 forks source link

Convert numpy.int64 to python native int in 'random_scale' #48

Closed smarginatura closed 3 months ago

smarginatura commented 8 months ago

This pull request addresses a TypeError triggered by the random_scale function in transform.py

TypeError

The error is encountered when running certain Colab notebooks based on lucent ( (eg:neuron_interaction) with PyTorch 2.1.

The issue is resolved by converting the scale_shape local variable from a list of numpy.int64 to native Python int, ensuring compatibility with nn.Upsample.

greentfrapp commented 3 months ago

SFLR but thanks for the update @smarginatura !