aesara icon indicating copy to clipboard operation
aesara copied to clipboard

Allow to set the name of a cloned variable with `clone(name="name")`

Open rlouf opened this issue 2 years ago • 2 comments

To set the name of a cloned variable we need to do:

import aesara.tensor as at

x = at.vector("x")
x_clone = x.clone()
x_clone.name = f"{x.name}_clone"

where it would be more succinct to be able to write:

import aesara.tensor as at

x = at.vector("x")
x_clone = x.clone(name=f"{x.name}_clone")

rlouf avatar Oct 31 '22 16:10 rlouf

I can take a look at this. Seems to only be in one location at first glance. Are there any of the initializations in type module that act differently? Appears they all inherit from the same.

wd60622 avatar Nov 01 '22 03:11 wd60622

By all means! You may want to do a project search for def clone, this is a part of the codebase I don't know very well.

rlouf avatar Nov 01 '22 10:11 rlouf