Skip to content

Commit d1c5820

Browse files
authored
Replaces deprecated use of numpy#fromstring method with #frombuffer (#7004)
This method has been deprecated since version 1.14, and it started raising an error in 2.3, according to the [release notes](https://github.com/numpy/numpy/releases/tag/v2.3.0rc1) A replacement with more appropriate semantics exists, so this change updates that use case to use the appropriate, non-deprecated method `frombuffer`. Googlers, see b/422161123.
1 parent f0f86bd commit d1c5820

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorboard/plugins/projector/projector_plugin_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def testEndpointsNoAssets(self):
209209

210210
def _AssertTensorResponse(self, tensor_bytes, expected_tensor):
211211
tensor = np.reshape(
212-
np.fromstring(tensor_bytes, dtype=np.float32), expected_tensor.shape
212+
np.frombuffer(tensor_bytes, dtype=np.float32), expected_tensor.shape
213213
)
214214
self.assertTrue(np.array_equal(tensor, expected_tensor))
215215

0 commit comments

Comments
 (0)