-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f8beab
commit d75366c
Showing
13 changed files
with
271 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Tensorflow | ||
{ | ||
public class ParsedSliceArgs | ||
{ | ||
public int[] Begin { get; set; } | ||
public Tensor PackedBegin { get; set; } | ||
public int[] End { get; set; } | ||
public Tensor PackedEnd { get; set; } | ||
public int[] Strides { get; set; } | ||
public Tensor PackedStrides { get; set; } | ||
public int BeginMask { get; set; } | ||
public int EndMask { get; set; } | ||
public int ShrinkAxisMask { get; set; } | ||
public int NewAxisMask { get; set; } | ||
public int EllipsisMask { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using NumSharp; | ||
|
||
namespace Tensorflow | ||
{ | ||
public partial class Tensor | ||
{ | ||
/// <summary> | ||
/// Used to keep the original variable when slicing | ||
/// </summary> | ||
public ResourceVariable OriginalVar { get; set; } | ||
public ParsedSliceArgs OriginalVarSlice { get; set; } | ||
|
||
public ResourceVariable assign(Tensor tensor) | ||
{ | ||
if (OriginalVar != null) | ||
{ | ||
OriginalVar.StridedSliceAssign(tensor, OriginalVarSlice); | ||
return OriginalVar; | ||
} | ||
else | ||
throw new RuntimeError("Operation doesn't support."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.