@@ -52,7 +52,7 @@ namespace Tensorflow | |||||
var results = m.Name switch | var results = m.Name switch | ||||
{ | { | ||||
"_AddGrad" => math_grad._AddGrad(oper, out_grads), | |||||
/*"_AddGrad" => math_grad._AddGrad(oper, out_grads), | |||||
"_AddV2Grad" => math_grad._AddV2Grad(oper, out_grads), | "_AddV2Grad" => math_grad._AddV2Grad(oper, out_grads), | ||||
"_BiasAddGrad" => nn_grad._BiasAddGrad(oper, out_grads), | "_BiasAddGrad" => nn_grad._BiasAddGrad(oper, out_grads), | ||||
"_CastGrad" => math_grad._CastGrad(oper, out_grads), | "_CastGrad" => math_grad._CastGrad(oper, out_grads), | ||||
@@ -79,7 +79,7 @@ namespace Tensorflow | |||||
"_SigmoidGrad" => math_grad._SigmoidGrad(oper, out_grads), | "_SigmoidGrad" => math_grad._SigmoidGrad(oper, out_grads), | ||||
"_SumGrad" => math_grad._SumGrad(oper, out_grads), | "_SumGrad" => math_grad._SumGrad(oper, out_grads), | ||||
"_SubGrad" => math_grad._SubGrad(oper, out_grads), | "_SubGrad" => math_grad._SubGrad(oper, out_grads), | ||||
"_StridedSliceGrad" => array_grad._StridedSliceGrad(oper, out_grads), | |||||
"_StridedSliceGrad" => array_grad._StridedSliceGrad(oper, out_grads),*/ | |||||
_ => g.InvokeMember(m.Name, | _ => g.InvokeMember(m.Name, | ||||
BindingFlags.InvokeMethod, | BindingFlags.InvokeMethod, | ||||
null, | null, | ||||
@@ -5,7 +5,7 @@ | |||||
<AssemblyName>TensorFlow.NET</AssemblyName> | <AssemblyName>TensorFlow.NET</AssemblyName> | ||||
<RootNamespace>Tensorflow</RootNamespace> | <RootNamespace>Tensorflow</RootNamespace> | ||||
<TargetTensorFlow>2.2.0</TargetTensorFlow> | <TargetTensorFlow>2.2.0</TargetTensorFlow> | ||||
<Version>0.60.4</Version> | |||||
<Version>0.60.5</Version> | |||||
<LangVersion>9.0</LangVersion> | <LangVersion>9.0</LangVersion> | ||||
<Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> | <Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> | ||||
@@ -27,17 +27,8 @@ namespace Tensorflow | |||||
public Tensor this[int index] | public Tensor this[int index] | ||||
{ | { | ||||
get | |||||
{ | |||||
if (Length == 1) | |||||
return items[0][index]; | |||||
return items[index]; | |||||
} | |||||
set | |||||
{ | |||||
items[index] = value; | |||||
} | |||||
get => items[index]; | |||||
set => items[index] = value; | |||||
} | } | ||||
public Tensor this[params string[] slices] | public Tensor this[params string[] slices] | ||||
@@ -7,7 +7,7 @@ | |||||
<Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
<RootNamespace>Tensorflow.Keras</RootNamespace> | <RootNamespace>Tensorflow.Keras</RootNamespace> | ||||
<Platforms>AnyCPU;x64</Platforms> | <Platforms>AnyCPU;x64</Platforms> | ||||
<Version>0.6.4</Version> | |||||
<Version>0.6.5</Version> | |||||
<Authors>Haiping Chen</Authors> | <Authors>Haiping Chen</Authors> | ||||
<Product>Keras for .NET</Product> | <Product>Keras for .NET</Product> | ||||
<Copyright>Apache 2.0, Haiping Chen 2021</Copyright> | <Copyright>Apache 2.0, Haiping Chen 2021</Copyright> | ||||
@@ -159,7 +159,7 @@ namespace TensorFlowNET.Keras.UnitTest | |||||
{ | { | ||||
var inputs = tf.constant(np.arange(10).reshape((5, 2)) * 10, dtype: tf.float32); | var inputs = tf.constant(np.arange(10).reshape((5, 2)) * 10, dtype: tf.float32); | ||||
var layer = keras.layers.LayerNormalization(axis: 1); | var layer = keras.layers.LayerNormalization(axis: 1); | ||||
var output = layer.Apply(inputs); | |||||
Tensor output = layer.Apply(inputs); | |||||
Assert.AreEqual((5, 2), output.shape); | Assert.AreEqual((5, 2), output.shape); | ||||
Assert.IsTrue(output[0].numpy().Equals(new[] { -0.99998f, 0.99998f })); | Assert.IsTrue(output[0].numpy().Equals(new[] { -0.99998f, 0.99998f })); | ||||
} | } | ||||