You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, given some LayerRef (which can be thought of as a normal tensor, when comparing our code conceptually to PyTorch or TensorFlow), we cannot really get any information about it (despite the layer ref), such as its dtype or shape.
It would not be too hard to make it available though because all RETURNN layers have get_out_data_from_opts where this can be inferred. And this function get_out_data_from_opts is by design not involving any TF operation, or adding anything to the current active TF computation graph. (There are some smaller technical things to be considered with this approach but they are all easily solvable.)
Having this would allow to more easily check e.g. if the input is sparse (maybe for #38), maybe reusing or checking for specific dim tags, etc.
We can either make just the RETURNN Data instance available as-is (LayerRef.data), or provide some more simple wrappers, like LayerRef.shape = data.dim_tags or (or with #48, more like LayerRef.shape = set(data.dim_tags)) or so.
Currently, given some
LayerRef
(which can be thought of as a normal tensor, when comparing our code conceptually to PyTorch or TensorFlow), we cannot really get any information about it (despite the layer ref), such as its dtype or shape.It would not be too hard to make it available though because all RETURNN layers have
get_out_data_from_opts
where this can be inferred. And this functionget_out_data_from_opts
is by design not involving any TF operation, or adding anything to the current active TF computation graph. (There are some smaller technical things to be considered with this approach but they are all easily solvable.)Having this would allow to more easily check e.g. if the input is sparse (maybe for #38), maybe reusing or checking for specific dim tags, etc.
We can either make just the RETURNN
Data
instance available as-is (LayerRef.data
), or provide some more simple wrappers, likeLayerRef.shape = data.dim_tags
or (or with #48, more likeLayerRef.shape = set(data.dim_tags)
) or so.This is also very related to #17.
The text was updated successfully, but these errors were encountered: