Open ghsanti opened 3 months ago
In the example above, z_in
has a dtype
attribute which in this case has value "float32"
.
But I mean type information for type hints, currently z_in
is marked as Unknown
. This is from the blueprint of Input, for example:
(function) def Input(
shape: Unknown | None = None,
batch_size: Unknown | None = None,
dtype: Unknown | None = None,
sparse: Unknown | None = None,
batch_shape: Unknown | None = None,
name: Unknown | None = None,
tensor: Unknown | None = None,
optional: bool = False
) -> (Unknown | Any | list[Unknown])
This makes it difficult: -> (Unknown | Any | list[Unknown])
@fchollet
Linked issue was solved using Jedi (or a workaround for Pylance.)
But this issue isn't resolved yet i.e how to get typing information on class instances.
Is this planned? Do you need help with it? @mehtamansi29
I'd find having this types quite useful since I'm new to Keras.
Executing any of the layers, for example:
The return type is Unknown, which means we don't have hints for the methods of z_in.
Certainly we could do
cast(KerasTensor,z_in)
but that would need to be done with every layer, every time.Any ideas @mehtamansi29 ?