Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update usage of numpy to reflect numpy 2.0 changes #6871

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorboard/compat/tensorflow_stub/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def as_dtype(type_value):
# dtype with a single constant (np.string does not exist) to decide
# dtype is a "string" type. We need to compare the dtype.type to be
# sure it's a string type.
if type_value.type == np.string_ or type_value.type == np.unicode_:
if type_value.type == np.bytes_ or type_value.type == np.str_:
return string

if isinstance(type_value, (type, np.dtype)):
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/util/tensor_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def GetNumpyAppendFn(dtype):
# dtype with a single constant (np.string does not exist) to decide
# dtype is a "string" type. We need to compare the dtype.type to be
# sure it's a string type.
if dtype.type == np.string_ or dtype.type == np.unicode_:
if dtype.type == np.bytes_ or dtype.type == np.str_:
return SlowAppendObjectArrayToTensorProto
return GetFromNumpyDTypeDict(_NP_TO_APPEND_FN, dtype)

Expand Down
Loading