In a previous tf-macos version 2.12, this lead to an error during pile(). However, no legacy version of the AdamW optimizer exists. When calling pile() with the AdamW optimizer, a warning is thrown saying that v2.11+ optimizers have a known slowdown on M1/M2 devices, and so the backend attempts to fallback to a legacy version. I initially raised this issue in the tensorflow forum, and they directed me back here since this is a tf-macos specific problem. I tested the same code in a colab environment and the result was as expectedĪnd this is correct and consistent with the documentation Which is obviously wrong at every passage Print("Final Sorted Indices:", sorted_indices.numpy()) Sorted_indices = multi_column_argsort(points, columns_order) To test this I used the following example: Print("Sorted Indices After:", sorted_indices.numpy())Īfter debugging this function for a while I found out that it was not sorting the 3 columns as expected because the argsort were not stable i.e. Sorted_indices = tf.gather(sorted_indices, col_argsort) Print("Sorted Indices Before:", sorted_indices.numpy()) Print("Col Argsort:", col_argsort.numpy()) Print("Column Values:", col_vals.numpy()) Sorted_indices = tf.range(start=0, limit=tf.shape(tensor), dtype=tf.int32)Ĭol_vals = tf.gather(tensor, sorted_indices)Ĭol_argsort = tf.argsort(col_vals, stable=True) So I implemented the following function:ĭef multi_column_argsort(tensor, columns_order): For a tensorflow layer I need a multi column argsort.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |