| @@ -441,7 +441,7 @@ namespace Tensorflow | |||
| return math_ops.reduce_sum(input, keepdims: keepdims, name: name); | |||
| } | |||
| public Tensor reduce_sum(Tensor input, int[] axis, int? reduction_indices = null, | |||
| public Tensor reduce_sum(Tensor input, TensorShape axis, int? reduction_indices = null, | |||
| bool keepdims = false, string name = null) | |||
| => math_ops.reduce_sum(input, axis, keepdims: keepdims, name: name); | |||
| @@ -456,6 +456,9 @@ namespace Tensorflow | |||
| public Tensor reduce_max(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) | |||
| => math_ops.reduce_max(input_tensor, axis, keepdims, name); | |||
| public Tensor reduce_max(Tensor input_tensor, int axis, bool keepdims = false, string name = null) | |||
| => math_ops.reduce_max(input_tensor, axis, keepdims, name); | |||
| public Tensor reduce_min(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) | |||
| => math_ops.reduce_min(input_tensor, axis, keepdims, name); | |||
| @@ -186,6 +186,11 @@ namespace Tensorflow | |||
| if (op_def == null) | |||
| op_def = g.GetOpDef(node_def.Op); | |||
| if (node_def.Name.Equals("learn_rate/cond/pred_id")) | |||
| { | |||
| } | |||
| var grouped_inputs = _reconstruct_sequence_inputs(op_def, inputs, node_def.Attr); | |||
| _handle = ops._create_c_op(g, node_def, grouped_inputs, control_input_ops.ToArray()); | |||
| _is_stateful = op_def.IsStateful; | |||
| @@ -629,9 +629,9 @@ namespace Tensorflow | |||
| public static Tensor _abs(Tensor x, string name = null) | |||
| { | |||
| var _op = _op_def_lib._apply_op_helper("Abs", name, new { x }); | |||
| var _op = _op_def_lib._apply_op_helper("Abs", name, args: new { x }); | |||
| return _op.outputs[0]; | |||
| return _op.output; | |||
| } | |||
| public static Tensor _any<Tx, Ty>(Tx input, Ty axis, bool keep_dims = false, string name = null) | |||
| @@ -662,14 +662,7 @@ namespace Tensorflow | |||
| return _op.outputs[0]; | |||
| } | |||
| public static Tensor _sum(Tensor input, Tensor axis = null, bool keep_dims = false, string name = null) | |||
| { | |||
| var _op = _op_def_lib._apply_op_helper("Sum", name, args: new { input, reduction_indices = axis, keep_dims }); | |||
| return _op.outputs[0]; | |||
| } | |||
| public static Tensor _sum(Tensor input, int axis, bool keep_dims = false, string name = null) | |||
| public static Tensor _sum<Tx, Ty>(Tx input, Ty axis = default, bool keep_dims = false, string name = null) | |||
| { | |||
| var _op = _op_def_lib._apply_op_helper("Sum", name, args: new { input, reduction_indices = axis, keep_dims }); | |||
| @@ -31,6 +31,7 @@ namespace Tensorflow | |||
| { | |||
| return tf_with(ops.name_scope(name, "Abs", new { x }), scope => | |||
| { | |||
| name = scope; | |||
| x = ops.convert_to_tensor(x, name: "x"); | |||
| if (x.dtype.is_complex()) | |||
| throw new NotImplementedException("math_ops.abs for dtype.is_complex"); | |||
| @@ -379,6 +380,13 @@ namespace Tensorflow | |||
| return _may_reduce_to_scalar(keepdims, axis, max); | |||
| } | |||
| public static Tensor reduce_max(Tensor input_tensor, int axis, bool keepdims = false, string name = null) | |||
| { | |||
| var r = _ReductionDims(input_tensor, axis); | |||
| var max = gen_math_ops._max(input_tensor, r, keepdims, name); | |||
| return _may_reduce_to_scalar(keepdims, axis, max); | |||
| } | |||
| public static Tensor reduce_min(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) | |||
| { | |||
| var r = _ReductionDims(input_tensor, axis); | |||
| @@ -434,15 +442,14 @@ namespace Tensorflow | |||
| public static Tensor reduce_sum(Tensor input_tensor, int[] axis, bool keepdims = false, string name = null) | |||
| { | |||
| var r = _ReductionDims(input_tensor, axis); | |||
| var m = gen_math_ops._sum(input_tensor, r, keep_dims: keepdims, name: name); | |||
| var m = gen_math_ops._sum(input_tensor, axis, keep_dims: keepdims, name: name); | |||
| return _may_reduce_to_scalar(keepdims, axis, m); | |||
| } | |||
| public static Tensor reduce_sum(Tensor input_tensor, int axis, bool keepdims = false, string name = null) | |||
| { | |||
| var m = gen_math_ops._sum(input_tensor, axis, keep_dims: keepdims, name: name); | |||
| return _may_reduce_to_scalar(keepdims, new int[] { axis }, m); | |||
| return _may_reduce_to_scalar(keepdims, axis, m); | |||
| } | |||
| private static Tensor _may_reduce_to_scalar(bool keepdims, Tensor axis, Tensor output) | |||
| @@ -464,6 +471,11 @@ namespace Tensorflow | |||
| return output; | |||
| } | |||
| private static Tensor _may_reduce_to_scalar(bool keepdims, int axis, Tensor output) | |||
| { | |||
| return output; | |||
| } | |||
| private static Tensor _ReductionDims(Tensor x, Tensor axis) | |||
| { | |||
| if (axis != null) | |||
| @@ -477,6 +489,11 @@ namespace Tensorflow | |||
| } | |||
| } | |||
| private static int _ReductionDims(Tensor x, int axis) | |||
| { | |||
| return axis; | |||
| } | |||
| private static Tensor _ReductionDims(Tensor x, int[] axis) | |||
| { | |||
| if (axis != null) | |||
| @@ -328,18 +328,16 @@ namespace Tensorflow | |||
| switch (name.ToLowerInvariant()) | |||
| { | |||
| case "add": | |||
| result = gen_math_ops.add(x1, y1, name: scope); | |||
| result = math_ops.add(x1, y1, name: scope); | |||
| break; | |||
| case "div": | |||
| result = _intTfDataTypes.Contains(x1.dtype) || _intTfDataTypes.Contains(y1.dtype) | |||
| ? gen_math_ops.floor_div(x1, y1, name: scope) | |||
| : gen_math_ops.real_div(x1, y1, name: scope); | |||
| result = math_ops.div(x1, y1, name: scope); | |||
| break; | |||
| case "floordiv": | |||
| result = gen_math_ops.floor_div(x1, y1, name: scope); | |||
| break; | |||
| case "truediv": | |||
| result = gen_math_ops.real_div(x1, y1, name: scope); | |||
| result = math_ops.truediv(x1, y1, name: scope); | |||
| break; | |||
| case "mul": | |||
| result = gen_math_ops.mul(x1, y1, name: scope); | |||