File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ public static TensorShapeProto as_shape(long[] dims)
8989 return shape ;
9090 }
9191
92+ public static TensorShape to_shape ( long [ ] dims )
93+ {
94+ return new TensorShape ( dims . Select ( x => ( int ) x ) . ToArray ( ) ) ;
95+ }
96+
9297 public static TensorShape as_shape ( this IShape shape , int [ ] dims )
9398 {
9499 return new TensorShape ( dims ) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public partial class RefVariable : VariableV1
1818 public Operation initializer => _initializer_op ;
1919 public Operation op => _variable . op ;
2020 public TF_DataType dtype => _variable . dtype ;
21+ public TensorShape shape => tensor_util . to_shape ( _variable . shape ) ;
2122
2223 public string name => _variable . name ;
2324
You can’t perform that action at this time.
0 commit comments