On checking the current implementation, I could see that linspace did require an extra “steps” argument which was not passed in current implementation. Hence, the error.
Here is the temporary fix I did to get rid of the error.
def plot_function(f, tx=None, ty=None, title=None, min=-2, max=2, figsize=(6,4)):
x = torch.linspace(min,max, steps=**20**)
#print("These are the stepped points", x)
fig,ax = plt.subplots(figsize=figsize)
ax.plot(x,f(x))
if tx is not None: ax.set_xlabel(tx)
if ty is not None: ax.set_ylabel(ty)
if title is not None: ax.set_title(title)
Let me know if this is an actual issue or I missed anything.
I had also got same error. Many thanks @Amay for above solution .
You saved my day.As fast.ai team should merge your solution into their main branch @fastai_geek
I just double-checked and it’s working for me with the latest version of fastbook. I’ve just pushed another release just in case. Can you upgrade and try again please?
Hi guys, for some who want a workaround, I fix the parameter -stepsize- of the torch’s linespace function to 100 (in the plot_function method located in utils.py file) value that based on what I read was the default, and it works now