| @@ -65,7 +65,8 @@ namespace Tensorflow | |||||
| public virtual NDArray run(ITensorOrOperation fetche, params FeedItem[] feed_dict) | public virtual NDArray run(ITensorOrOperation fetche, params FeedItem[] feed_dict) | ||||
| { | { | ||||
| return _run(fetche, feed_dict)[0]; | |||||
| var results = _run(fetche, feed_dict); | |||||
| return fetche is Tensor ? results[0] : null; | |||||
| } | } | ||||
| public virtual (NDArray, NDArray, NDArray, NDArray, NDArray) run( | public virtual (NDArray, NDArray, NDArray, NDArray, NDArray) run( | ||||
| @@ -132,6 +132,17 @@ namespace TensorFlowNET.UnitTest | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| [TestMethod] | |||||
| public void Autocast_Case0() | |||||
| { | |||||
| var sess = tf.Session().as_default(); | |||||
| ITensorOrOperation operation = tf.global_variables_initializer(); | |||||
| // the cast to ITensorOrOperation is essential for the test of this method signature | |||||
| var ret = sess.run(operation); | |||||
| ret.Should().BeNull(); | |||||
| } | |||||
| [TestMethod] | [TestMethod] | ||||
| public void Autocast_Case1() | public void Autocast_Case1() | ||||