Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tensorflow.go, option.go #261

Merged
merged 5 commits into from
Apr 23, 2020
Merged

fix tensorflow.go, option.go #261

merged 5 commits into from
Apr 23, 2020

Conversation

datelier
Copy link
Contributor

@datelier datelier commented Feb 28, 2020

Signed-off-by: datelier 57349093+datelier@users.noreply.github.com

Description:

Related Issue:

How Has This Been Tested?:

Environment:

  • Golang Version: 1.13.5
  • Docker Version: 19.03.5
  • Kubernetes Version: 1.16.3
  • NGT Version: 1.8.4

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensure all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@pull-assistant
Copy link

pull-assistant bot commented Feb 28, 2020

Score: 0.88

Best reviewed: commit by commit


Optimal code review plan

     fix tensorflow.go, option.go

     fix TF interface

     fix magic number, nil check

     add ml tasks to Makefile

     fix const value name

Powered by Pull Assistant. Last update c39571a ... 4eeda50. Read the comment docs.

@@ -26,7 +26,9 @@ type SessionOptions = tf.SessionOptions
type Operation = tf.Operation

type TF interface {
GetVector(feeds []Feed, fetches []Fetch, targets ...*Operation) (values [][][]float64, err error)
GetVector(feeds []Feed, fetch Fetch, targets ...*Operation) ([]float64, error)
Copy link
Collaborator

@kpango kpango Feb 28, 2020

Choose a reason for hiding this comment

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

Suggested change
GetVector(feeds []Feed, fetch Fetch, targets ...*Operation) ([]float64, error)
GetVector(seeds ...[]byte) ([]float64, error)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

for _, result := range results {
value, ok := result.Value().([][]float64)
switch t.ndim {
case 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
mnd: Magic number: 2, in detected (gomnd)

} else {
return nil, errors.ErrFailedToCastTF(tensors[0].Value())
}
case 3:
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
mnd: Magic number: 3, in detected (gomnd)

@datelier datelier marked this pull request as ready for review March 18, 2020 07:58
}
const (
TWO_DIM int8 = 2
THREE_DIM int8 = 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

In golang const value we shouldn't use snake case please use camel case, and I recommend below

Suggested change
THREE_DIM int8 = 3
NoDim uint8 = iota
OneDim
TwoDim
ThreeDim

Signed-off-by: datelier <57349093+datelier@users.noreply.github.com>
Signed-off-by: datelier <57349093+datelier@users.noreply.github.com>
Signed-off-by: datelier <57349093+datelier@users.noreply.github.com>
Signed-off-by: datelier <57349093+datelier@users.noreply.github.com>
Signed-off-by: datelier <57349093+datelier@users.noreply.github.com>
@kpango
Copy link
Collaborator

kpango commented Apr 23, 2020

/rebase
/format

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kpango for branch: feature/tensorflow

@vdaas-ci
Copy link
Collaborator

[REBASE] Failed to rebase.

@kpango kpango merged commit e46d63f into master Apr 23, 2020
@kpango kpango deleted the feature/tensorflow branch April 23, 2020 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants