Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix DataBatch.__str__ for cases where we don't have labels. #9645

Merged
merged 1 commit into from
Feb 3, 2018

Conversation

larroy
Copy link
Contributor

@larroy larroy commented Jan 31, 2018

Description

If there's no label, DataBatch throws when printing or converting to str

Checklist

Essentials

  • Passed code style checking (make lint)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@larroy larroy requested a review from szha as a code owner January 31, 2018 12:43
Copy link
Member

@szha szha left a comment

Choose a reason for hiding this comment

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

fix test please

batch = DataBatch(data=[mx.nd.ones((2,3))])
eq_(str(batch),'DataBatch: data shapes: [(2, 3)] label shapes: None')
batch = DataBatch(data=[mx.nd.ones((2,3)), mx.nd.ones((7,8))], label=[mx.nd.ones((4,5))])
eq_(str(batch),'DataBatch: data shapes: [(2, 3), (7, 8)] label shapes: [(4, 5)]')
Copy link
Member

Choose a reason for hiding this comment

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

space after comma

@larroy larroy force-pushed the databatch branch 3 times, most recently from 5f4f054 to 75711b0 Compare February 1, 2018 10:56
@szha szha merged commit fe5b56e into apache:master Feb 3, 2018
@larroy larroy deleted the databatch branch February 8, 2018 01:19
rahul003 pushed a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
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.

3 participants