Skip to content

Conversation

@tafsiri
Copy link
Contributor

@tafsiri tafsiri commented Jul 10, 2020

modularize, clipByValue, erf, exp, expm1, log, log1p, logSigmoid, reciprocal
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

Copy link
Contributor

@annxingyuan annxingyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @annxingyuan, @lina128, and @tafsiri)


tfjs-backend-wasm/src/kernels/ClipByValue.ts, line 25 at r1 (raw file):

function setup(backend: BackendWasm) {
  wasmClip = backend.wasm.cwrap('ClipByValue', null /* void */, [

Use symbol here


tfjs-core/src/gradients/ClipByValue_grad.ts, line 33 at r1 (raw file):

    const {clipValueMin, clipValueMax} = attrs as {} as ClipByValueAttrs;
    return {
      // tslint:disable-next-line: no-unnecessary-type-assertion

Is this tslint needed?


tfjs-core/src/ops/erf.ts, line 46 at r1 (raw file):

      () => 'Input dtype must be `int32` or `float32`.');

  if ($x.dtype === 'int32') {

sorry if I'm misremembering - did we decide that casts should go into the forwardfunc?

Copy link
Contributor Author

@tafsiri tafsiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @annxingyuan and @lina128)


tfjs-backend-wasm/src/kernels/ClipByValue.ts, line 25 at r1 (raw file):

Previously, annxingyuan (Ann Yuan) wrote…

Use symbol here

Done. I don't know if we've doing this so far and it isn't strictly required but it think its a good idea to reduce variance in naming. Should we do this in other kernels as well?


tfjs-core/src/gradients/ClipByValue_grad.ts, line 33 at r1 (raw file):

Previously, annxingyuan (Ann Yuan) wrote…

Is this tslint needed?

Nope. And i removed the chained where. Done


tfjs-core/src/ops/erf.ts, line 46 at r1 (raw file):

Previously, annxingyuan (Ann Yuan) wrote…

sorry if I'm misremembering - did we decide that casts should go into the forwardfunc?

Generally yes, but in this case, according to ops.pbtxt, erf does not take int tensors. So this cast is a convenience of the tfjs public api

Copy link
Contributor

@annxingyuan annxingyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @annxingyuan, @lina128, and @tafsiri)


tfjs-backend-wasm/src/kernels/ClipByValue.ts, line 25 at r1 (raw file):

Previously, tafsiri (Yannick Assogba) wrote…

Done. I don't know if we've doing this so far and it isn't strictly required but it think its a good idea to reduce variance in naming. Should we do this in other kernels as well?

Yeah I think it would be a good idea. This can be one of the things we do in the final WASM cleanup PR, along with making sure WASM kernels are using interfaces from kernel_names.ts rather than defining their own.

@tafsiri tafsiri changed the title modularize more unary ops modularize unary ops Jul 13, 2020
@tafsiri tafsiri merged commit 350fa45 into master Jul 13, 2020
@tafsiri tafsiri deleted the mod-unary-3 branch July 13, 2020 14:50
@rthadur rthadur mentioned this pull request Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants