diff --git a/stubs/tensorflow/@tests/stubtest_allowlist.txt b/stubs/tensorflow/@tests/stubtest_allowlist.txt index adb4f38f5da8..57cd5b91a724 100644 --- a/stubs/tensorflow/@tests/stubtest_allowlist.txt +++ b/stubs/tensorflow/@tests/stubtest_allowlist.txt @@ -47,6 +47,8 @@ tensorflow._aliases # but the real module file is completely different name (even package) and dynamically handled. # tf.initializers at runtime is tensorflow.initializers +# Another cursed import magic similar to the one above. +tensorflow.distribute.experimental.coordinator # Layer constructor's always have **kwargs, but only allow a few specific values. PEP 692 # would allow us to specify this with **kwargs and remove the need for these exceptions. diff --git a/stubs/tensorflow/tensorflow/distribute/experimental/coordinator.pyi b/stubs/tensorflow/tensorflow/distribute/experimental/coordinator.pyi new file mode 100644 index 000000000000..cc59692e72ec --- /dev/null +++ b/stubs/tensorflow/tensorflow/distribute/experimental/coordinator.pyi @@ -0,0 +1,12 @@ +from _typeshed import Incomplete +from typing import Generic, TypeVar + +from tensorflow._aliases import AnyArray + +_Value = TypeVar("_Value", covariant=True) + +class RemoteValue(Generic[_Value]): + def fetch(self) -> AnyArray: ... + def get(self) -> _Value: ... + +def __getattr__(name: str) -> Incomplete: ...