mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Replace np.float_ alias removed in numpy 2.0 (#12138)
This commit is contained in:
@@ -65,7 +65,7 @@ ContainerTensorShape: TypeAlias = ContainerGeneric[tf.TensorShape]
|
||||
ContainerInputSpec: TypeAlias = ContainerGeneric[InputSpec]
|
||||
|
||||
AnyArray: TypeAlias = npt.NDArray[Any]
|
||||
FloatArray: TypeAlias = npt.NDArray[np.float_ | np.float16 | np.float32 | np.float64]
|
||||
FloatArray: TypeAlias = npt.NDArray[np.float16 | np.float32 | np.float64]
|
||||
UIntArray: TypeAlias = npt.NDArray[np.uint | np.uint8 | np.uint16 | np.uint32 | np.uint64]
|
||||
SignedIntArray: TypeAlias = npt.NDArray[np.int_ | np.int8 | np.int16 | np.int32 | np.int64]
|
||||
IntArray: TypeAlias = UIntArray | SignedIntArray
|
||||
|
||||
@@ -84,7 +84,7 @@ class Model(Layer[_InputT, _OutputT]):
|
||||
validation_data: TensorCompatible | tf.data.Dataset[Any] | None = None,
|
||||
shuffle: bool = True,
|
||||
class_weight: dict[int, float] | None = None,
|
||||
sample_weight: npt.NDArray[np.float_] | None = None,
|
||||
sample_weight: npt.NDArray[np.float64] | None = None,
|
||||
initial_epoch: int = 0,
|
||||
steps_per_epoch: int | None = None,
|
||||
validation_steps: int | None = None,
|
||||
@@ -99,7 +99,7 @@ class Model(Layer[_InputT, _OutputT]):
|
||||
y: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete] | None = None,
|
||||
batch_size: int | None = None,
|
||||
verbose: Literal["auto", 0, 1, 2] = "auto",
|
||||
sample_weight: npt.NDArray[np.float_] | None = None,
|
||||
sample_weight: npt.NDArray[np.float64] | None = None,
|
||||
steps: int | None = None,
|
||||
callbacks: list[tf.keras.callbacks.Callback] | None = None,
|
||||
return_dict: bool = False,
|
||||
@@ -120,7 +120,7 @@ class Model(Layer[_InputT, _OutputT]):
|
||||
self,
|
||||
x: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete],
|
||||
y: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete] | None = None,
|
||||
sample_weight: npt.NDArray[np.float_] | None = None,
|
||||
sample_weight: npt.NDArray[np.float64] | None = None,
|
||||
class_weight: dict[int, float] | None = None,
|
||||
return_dict: bool = False,
|
||||
) -> float | list[float]: ...
|
||||
@@ -128,7 +128,7 @@ class Model(Layer[_InputT, _OutputT]):
|
||||
self,
|
||||
x: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete],
|
||||
y: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete] | None = None,
|
||||
sample_weight: npt.NDArray[np.float_] | None = None,
|
||||
sample_weight: npt.NDArray[np.float64] | None = None,
|
||||
return_dict: bool = False,
|
||||
) -> float | list[float]: ...
|
||||
def predict_on_batch(self, x: Iterator[_InputT]) -> npt.NDArray[Incomplete]: ...
|
||||
|
||||
Reference in New Issue
Block a user