java
java copied to clipboard
not found reducemean and tf.norm and tf.argsort method, if we support these operation in java or not?
HI
not found reducemean and tf.argsort and tf.norm for L1 or L2 method, if we support these operation in java or not?
Our tf.math.mean operation can be configured to do reduce_mean, depending on how keep_dims and the other arguments are set. There is a euclidean (L2) norm built in, but L1 will need to be composed out of abs and reduceSum. Argsort needs to be built out of the TopK operation, you can see how they do that in Python here https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/sort_ops.py#L186.
Our
tf.math.meanoperation can be configured to doreduce_mean, depending on how keep_dims and the other arguments are set. There is a euclidean (L2) norm built in, but L1 will need to be composed out ofabsandreduceSum. Argsort needs to be built out of theTopKoperation, you can see how they do that in Python here https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/sort_ops.py#L186.
thank you, but now I also have new question: the meshgrid operate method not found
scatter_nd operate do we support? I found Scatter.class
In general we only expose the ops which exist in the TensorFlow C API. If an op exists in Python but not in the C API then it means the op is composed out of multiple more primitive ops. So you can look up the op (https://www.tensorflow.org/api_docs/python/tf/meshgrid) and view the source (https://github.com/tensorflow/tensorflow/blob/v2.8.0/tensorflow/python/ops/array_ops.py#L3636-L3714) for it to see how that op is built. Meshgrid looks relatively simple to build from ops we do have.
ScatterNd is available in TF-Java here https://www.tensorflow.org/jvm/api_docs/java/org/tensorflow/op/core/ScatterNd.