-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
In particular, see here:
adeptRL/adept/network/modular_network.py
Lines 216 to 238 in 2d8b0d3
| # Dict[Dim, SubModule] | |
| # instantiate heads based on output_shapes | |
| head_submodules = {} | |
| for output_key, shape in output_space.items(): | |
| dim = len(shape) | |
| if dim in head_submodules: | |
| continue | |
| elif dim == 1: | |
| submod_cls = net_reg.lookup_submodule(args.head1d) | |
| elif dim == 2: | |
| submod_cls = net_reg.lookup_submodule(args.head2d) | |
| elif dim == 3: | |
| submod_cls = net_reg.lookup_submodule(args.head3d) | |
| elif dim == 4: | |
| submod_cls = net_reg.lookup_submodule(args.head4d) | |
| else: | |
| raise ValueError("Invalid dim: {}".format(dim)) | |
| submod = submod_cls.from_args( | |
| args, | |
| body_submod.output_shape(submod_cls.dim), | |
| "head" + str(dim) + "d", | |
| ) | |
| head_submodules[str(dim)] = submod |
In the following if-statement:
if dim in head_submodules:
continue
type(dim) == int; however, keys of head_submodules are guaranteed to be str due to the line head_submodules[str(dim)] = submod. This suggests that the above if-statement will never continue. Thoughts on this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels