Hi. I’m using a custom SameDiff
Gather Op
which extends a standard (native) one by overriding the doDiff()
method. The rest remains the same, including the Op’s name. It worked all the time with different DL4J
versions but after upgrading to M2 this Op is being ignored and automatically replaced by the standard one. After debugging the code I noticed that it happens because of always cloning the Ops (not sure why it happens all the time, even when there’s no importing etc.) in org.nd4j.autodiff.samediff.serde.FlatBuffersMapper#cloneViaSerialize()
. Manipulations with ImportClassMapping.getOpNameMapping()
by replacing the standard op with the custom one do the trick, but only when I train the model from scratch. If I load an existing same model (as usually) in order to copy the weights from it (the graph itself is not changed during this copying), somehow my custom Op, still remaining in ImportClassMapping.getOpNameMapping()
map, is again being ignored.
Would appreciate any tips on how to correctly configure my custom Op so that it doesn’t get kicked off and replaced by the standard one.
Thanks in advance!