Dynamically Setting out_dim Based on LightningDataModule in LightningCLI #20602
-
| Dynamically Setting  | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
| You have two options: 
 | 
Beta Was this translation helpful? Give feedback.
You have two options:
setupmethod so that if it is called multiple time, only the first run does the required logic. Then change thenum_of_labelsproperty so that it callssetupbefore accessing the_num_of_labelsattribute.datainstance (instead of an attribute of it) and acompute_fnthat first runssetupand then accesses thenum_of_labelsproperty.