Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Improve error message in tensorXd #1111

Merged
merged 5 commits into from
Jun 21, 2018

Conversation

Lewuathe
Copy link
Contributor

@Lewuathe Lewuathe commented Jun 17, 2018

Description

MISC

Throw an error message saying "The input must be non-null value" instead of saying "values is not a Flat/TypedArray" in case of null input value.

see: tensorflow/tfjs#424


For repository owners only:

Please remember to apply all applicable tags to your pull request.
Tags: FEATURE, BREAKING, BUG, PERF, DEV, DOC, SECURITY

For more info see: /~https://github.com/tensorflow/tfjs/blob/master/DEVELOPMENT.md


This change is Reviewable

@nsthorat
Copy link
Contributor

Review status: 0 of 1 LGTMs obtained


src/util.ts, line 106 at r1 (raw file):

  assert(
      a != null,
      `The input must be non-null value`);

How about:

"The input to the tensor constructor must be a non-null value."


src/ops/array_ops.ts, line 284 at r1 (raw file):

      values: TensorLike5D, shape?: [number, number, number, number, number],
      dtype: DataType = 'float32'): Tensor5D {
    assertNonNull(values);

Can you also do this for tensor6d (which was just added)?


Comments from Reviewable

@nsthorat
Copy link
Contributor

:lgtm_strong:


Review status: :shipit: complete! 1 of 1 LGTMs obtained


Comments from Reviewable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants