Apologies if this is a straightforward thing, I’m just not having luck getting answers online (and if this isn’t a good place to post).
I’ve been trying to improve my Python, and I’ve been trying to make sense of some code for a Neural Network/Natural Language Processing package. I came across this:
if args.encoder_layers_to_keep:
args.encoder_layers = len(args.encoder_layers_to_keep.split(","))
I haven’t come across an if statement with an expression like this. There’s no comparison between variables or anything. My only guess is that it returns a true or false value and works with that but I’m really not sure.
For reference, here’s the full script - https://github.com/pytorch/fairseq/blob/master/fairseq/models/transformer.py
I’d appreciate any help with this.
Thanks, Justin