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

Tensor extensions #4260

Merged
merged 21 commits into from
Oct 2, 2019
Merged

Tensor extensions #4260

merged 21 commits into from
Oct 2, 2019

Conversation

KsenijaS
Copy link
Member

Output tensors from graph are being copied from unamanaged to managed memory and every time a new buffer is created. Performance will be better if we reuse buffer when it's possible.
Improve performance by replacing ToArray method in Tensor class with extension methods: ToScalar, ToSpan and ToArray

@KsenijaS KsenijaS requested a review from a team as a code owner September 27, 2019 17:56
@eerhardt
Copy link
Member

eerhardt commented Sep 27, 2019

using System;

copyright header is needed on all code #Resolved


Refers to: src/Microsoft.ML.Dnn/TensorTypeExtensions.cs:1 in 0b2c97e. [](commit_id = 0b2c97e, deletion_comment = False)

@codecov
Copy link

codecov bot commented Sep 30, 2019

Codecov Report

Merging #4260 into master will decrease coverage by <.01%.
The diff coverage is 71.42%.

@@            Coverage Diff             @@
##           master    #4260      +/-   ##
==========================================
- Coverage   74.48%   74.48%   -0.01%     
==========================================
  Files         877      878       +1     
  Lines      153663   153688      +25     
  Branches    16828    16830       +2     
==========================================
+ Hits       114457   114469      +12     
- Misses      34474    34479       +5     
- Partials     4732     4740       +8
Flag Coverage Δ
#Debug 74.48% <71.42%> (-0.01%) ⬇️
#production 70.07% <71.42%> (-0.01%) ⬇️
#test 89.48% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
src/Microsoft.ML.Dnn/DnnUtils.cs 66.08% <ø> (-0.87%) ⬇️
src/Microsoft.ML.TensorFlow/TensorflowTransform.cs 74.07% <50%> (+0.12%) ⬆️
...c/Microsoft.ML.Dnn/ImageClassificationTransform.cs 77.31% <58.82%> (-0.32%) ⬇️
src/Microsoft.ML.Dnn/DnnRetrainTransform.cs 57.26% <75%> (+0.1%) ⬆️
src/Microsoft.ML.Dnn/TensorTypeExtensions.cs 81.81% <81.81%> (ø)
....ML.AutoML/PipelineSuggesters/PipelineSuggester.cs 79.83% <0%> (-6.73%) ⬇️
src/Microsoft.ML.AutoML/Sweepers/Parameters.cs 77.96% <0%> (-5.94%) ⬇️
...soft.ML.TestFramework/DataPipe/TestDataPipeBase.cs 73.6% <0%> (-0.33%) ⬇️
...soft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs 84.7% <0%> (-0.21%) ⬇️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.1% <0%> (-0.16%) ⬇️
... and 4 more

@Nucs
Copy link

Nucs commented Oct 1, 2019

After this PR will be merged, If needed - I'll add performant support for conversion between types instead of throwing NotSupportedException when types do not match. #Resolved

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

Just 2 comments. After those are addressed I believe this can be merged. Nice work.

Copy link
Member

@codemzs codemzs left a comment

Choose a reason for hiding this comment

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

:shipit:

@codemzs codemzs merged commit d290881 into dotnet:master Oct 2, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 2022
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.

4 participants