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

Upgrade: dmlc::optional<T> constructors and value() function #20560

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

mozga-intel
Copy link
Contributor

@mozga-intel mozga-intel commented Aug 30, 2021

Description

The class template std::optional manages an optional contained value, i.e. a value that may or may not be present. In this pull request, a few things were implemented, such as extended series of constructors and a function of value. Mainly, this pull request is a realization of changes that have an impact on constructors,(upgrade of dmlc::optional constructors):
[Draft] PR: #658

Checklist

Essentials

  • PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@mxnet-bot
Copy link

Hey @mozga-intel , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [sanity, edge, clang, miscellaneous, website, windows-cpu, unix-cpu, centos-cpu, centos-gpu, unix-gpu, windows-gpu]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@mseth10 mseth10 added the pr-work-in-progress PR is still work in progress label Aug 30, 2021
1. Constructs an object that does contain a nullopt value.
     optional(dmlc::nullopt_t) noexcept : is_none(true) {}
2. constructs an optional object that contains a value, initialized as if direct-initializing:
    template <typename U, typename... Args>
3. move constructor: If other contains a value, then stored value is direct-intialized with it.
     optional(optional &&other) noexcept() { }
4. move constructor: constructs the stored value with value with `other`parameter.
    optional(U &&other) noexcept {
5. (...)
Upgrade: dmlc::optional<T> value
1. T &value() &
2. const T &value() const &
3. T &&value() &
4. const T && value() const &&nter the commit message for your changes. Lines starting
@mozga-intel mozga-intel force-pushed the mozga-intel/optional_dmlc_move_support branch 2 times, most recently from e6a40b4 to ed94ab4 Compare September 1, 2021 14:24
@mozga-intel mozga-intel force-pushed the mozga-intel/optional_dmlc_move_support branch from 8f0bea4 to 577ce58 Compare September 3, 2021 20:19
@mozga-intel
Copy link
Contributor Author

@mxnet-bot run ci [centos-gpu, windows-cpu, windows-gpu ]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [centos-gpu, windows-cpu, windows-gpu]

@mozga-intel
Copy link
Contributor Author

@mxnet-bot run ci [unix-cpu]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [unix-cpu]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-work-in-progress PR is still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants