This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
scisharp
/
TensorFlow.NET
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
21
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
fix ndarray to tensor implicit convertion.
tags/v0.60-tf.numpy
Oceania2018
4 years ago
parent
efb1c242e1
commit
083c8e8d6f
2 changed files
with
7 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
src/TensorFlowNET.Core/Binding.Util.cs
+1
-1
src/TensorFlowNET.Core/NumPy/NDArray.Implicit.cs
+ 6
- 0
src/TensorFlowNET.Core/Binding.Util.cs
View File
@@ -508,6 +508,12 @@ namespace Tensorflow
public static Shape GetShape(this object data)
{
if (data is NDArray nd)
return nd.shape;
if (data is Tensor tensor)
return tensor.shape;
if (!data.GetType().IsArray)
return Shape.Scalar;
+ 1
- 1
src/TensorFlowNET.Core/NumPy/NDArray.Implicit.cs
View File
@@ -37,7 +37,7 @@ namespace Tensorflow.NumPy
=> new NDArray(value);
public static implicit operator Tensor(NDArray nd)
=>
nd._tensor
;
=>
constant_op.constant(nd)
;
public static implicit operator NDArray(Tensor tensor)
=> new NDArray(tensor);
Write
Preview
Loading…
Cancel
Save