The CompareLayer does not yet set the allow_broadcast_all_sources parameter of Data.get_common_data but instead leaves it on the default NotSpecified regardless of whether out_shape or out_type are set. The CompareLayer uses Data.get_common_data both in __init__ and in get_out_data_from_opts. For the latter, we could use the same code as the CombineLayer:
if sources:
allow_broadcast_all_sources = NotSpecified
if out_shape is not None:
allow_broadcast_all_sources = True
elif out_type and isinstance(out_type, dict) and ("shape" in out_type or "dim_tags" in out_type):
allow_broadcast_all_sources = True
out_type_.update(
Data.get_common_data(
[s.output for s in sources], allow_broadcast_all_sources=allow_broadcast_all_sources).get_kwargs())
For the former, however, we currently cannot check whether out_shape is set because out_shape is not an attribute of CompareLayer. Should we set self.out_shape in LayerBase? What do you think? @albertz @Zettelkasten
The
CompareLayer
does not yet set theallow_broadcast_all_sources
parameter ofData.get_common_data
but instead leaves it on the defaultNotSpecified
regardless of whetherout_shape
orout_type
are set. TheCompareLayer
usesData.get_common_data
both in__init__
and inget_out_data_from_opts
. For the latter, we could use the same code as theCombineLayer
:For the former, however, we currently cannot check whether
out_shape
is set becauseout_shape
is not an attribute ofCompareLayer
. Should we setself.out_shape
inLayerBase
? What do you think? @albertz @Zettelkasten