Welcome to the Linux Foundation Forum!

Use of unique(col) in lab2

In lab2 under 5.0.1 there is a method using col:

There is a line of code calling this method like so:

When the latter is run I get the following error:

If I refer to the finished lab to check for differences it uses a different library, the old torch data datapipes which have a different syntax.

Understanding:
My understanding is that we will pass in one string from cat_attr and call the method for each. Each gen_encoder_dict(series) call is going to run the unique() func and expect col to have a value BUT there is no access to that variable. I did try a couple different things, but I am not 100% sure what the proper fix would be for this since it appears this way in the lab & lesson notes.

Question
Does this code block compile and run on your side?

Categories

Upcoming Training