Closed sujitbiswas closed 6 years ago
@sujitbiswas Sorry for the late reply but I have been very busy with a paper deadline. I haven't currently implemented an interface to tf.image.decode_jpeg
but I will add one as soon as I get the chance. In general, to use the Op.Builder
class, you can look into the following:
xx_ops.cc
file you are interested in. These are located in the tensorflow/core/ops
directory in the main codebase. For example, in your case the file your interested in would be tensorflow/core/ops/image_ops.cc
.Op.Builder
with the name of the CC registered op as its opType
(e.g., "DecodeJpeg"
) and any name you wish.tensorflow/core/ops/array_ops.cc
, for example, and my corresponding op interfaces in org.platanios.tensorflow.api.ops.Basic
.build()
on the op builder and collect any outputs you wish. All op outputs are collected in a Scala sequence and the CC op registrations declare what they represent.Even though it may sound like a lot of steps you usually end up with 3-4 lines of code for each op.
You can also look in my classes for reference in how to add gradients for your ops, if you need to. I'm sorry this is not documented thus far, but I haven't gotten the chance yet. I'll do so when I find time, but I would also find it really helpful if you wrote a small piece with your experience trying to implement support for ops in my library (if you end up giving it a shot), because I would probably not be aware of all issues that may came up. A fresh opinion is always useful. :)
@eaplatanios is there a equivalent of tf.image.decode_jpeg or how can we directly use Op.Builder?