Implement ops and add functionality to bindings #70
Conversation
This is excellent - thank you so much! A few comments on the c++ ping me when they're updated and I'll rubber-stamp. Review status: 0 of 4 files reviewed at latest revision, all discussions resolved. binding/tfe_utils.cc, line 244 at r1 (raw file):
Sorry these macros are funny - inline bool IsArray(napi_env, napi_status& nstatus, napi_value* val) {
// Use in-param nstatus
} This way if an exception happens - it gets bubbled up through the nstatus passed in. binding/tfe_utils.cc, line 300 at r1 (raw file):
I wonder if we'll have to support this for TF_ATTR_FLOAT as well. Mind cleaning up this TODO: https://github.com/tensorflow/tfjs-node/blob/master/binding/tfe_utils.cc#L332 binding/tfe_utils.cc, line 302 at r1 (raw file):
There is already a binding/tfe_utils.cc, line 304 at r1 (raw file):
This actually allocates on the heap and you're on the hook to cleanup. I'd use std::unique_ptr<int64_t[]> values(new int64_t[num_values]); When binding/tfe_utils.cc, line 327 at r1 (raw file):
Ditto here with the nstatus reference. Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions. src/nodejs_kernel_backend.ts, line 325 at r1 (raw file):
I think we should do this at the op level and remove the kernel entirely, WDYT? Same for other places you implement the kernel as a combination of other ops. src/nodejs_kernel_backend.ts, line 660 at r1 (raw file):
thoughts on renaming our kernel methods to align with TF? So maxPoolBackprop => maxPoolGrad src/run_tests.ts, line 32 at r1 (raw file):
You can refer to the issue Comments from Reviewable |
PTAL. All comments addressed Review status: 0 of 4 files reviewed at latest revision, 8 unresolved discussions. binding/tfe_utils.cc, line 244 at r1 (raw file): Previously, nkreeger (Nick Kreeger) wrote…
Done. binding/tfe_utils.cc, line 300 at r1 (raw file): Previously, nkreeger (Nick Kreeger) wrote…
Added code for list of floats and list of bools and removed the TODO. Didn't add code for list of type and list of strings - we can add that as needed, since there is no way to test it's behavior right now, unless you call an op that actually uses it. binding/tfe_utils.cc, line 302 at r1 (raw file): Previously, nkreeger (Nick Kreeger) wrote…
Done. binding/tfe_utils.cc, line 304 at r1 (raw file): Previously, nkreeger (Nick Kreeger) wrote…
Done. Thanks! I have no idea what I'm doing, but eager to learn - thanks for the guidance :) binding/tfe_utils.cc, line 327 at r1 (raw file): Previously, nkreeger (Nick Kreeger) wrote…
Done. src/nodejs_kernel_backend.ts, line 325 at r1 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/nodejs_kernel_backend.ts, line 660 at r1 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
let's do it in another PR (potentially) src/run_tests.ts, line 32 at r1 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 8 unresolved discussions. Comments from Reviewable |
NOTE: Depends on tensorflow/tfjs-core#956
argMin
,argMax
,logicalXor
,log1p
,eluDer
,clip
,mod
,round
,sign
,rsqrt
,reciprocal
,asinh
,acosh
,atanh
,squaredDifference
,expm1
,atan2
,conv2d
,conv2dDerInput
,conv2dDerFilter
,maxPool
,maxPoolBackprop
,avgPool
,avgPoolBackprop
,tile
,resizeBilinear
,batchNorm
,LRN
,multinomial
,softplus
.depthwiseConv2D
fordilations=1
.dilations>1
requiresspaceToBatch
to be added to coretime
,memory
.float
andlist(int)
tfjs-core
testsnumber
since TF backend doesn't have kernels for that - onlyvalid
andsame
is supported. We support padding typenumber
in the webgl and cpu backend.This change is