Repository navigation
Closed
Description
The following code snippet throws a NullReferenceException on the last line (running under Preview 4).
Previously this left_shift method worked great in version 0.15.1, I'm not sure if perhaps there is something more needed in my code for compatibility with TF Version 2 or if this represents a bug.
Thank you.
tf.enable_eager_execution();
using (var graph = tf.Graph())
{
Tensor bits = tf.constant(new int[] { 0, 1}, dtype: tf.int64);
Tensor ones = tf.ones(new TensorShape(new int[] { 2 }), TF_DataType.TF_INT64);
Tensor bitMasks = Tensorflow.Operations.gen_ops.left_shift(ones, bits);
}
-------------------------------------------------
Tensorflow.Operation.implicit operator System.IntPtr(Tensorflow.Operation op) Line 31
Tensorflow.Tensor._as_tf_output() Line 205
Tensorflow.ops._create_c_op<object>(Tensorflow.Graph graph, Tensorflow.NodeDef node_def, object[] inputs, Tensorflow.Operation[] control_inputs)
Tensorflow.Operation.Operation(Tensorflow.NodeDef node_def, Tensorflow.Graph g, Tensorflow.Tensor[] inputs, Tensorflow.TF_DataType[] output_types, Tensorflow.ITensorOrOperation[] control_inputs, Tensorflow.TF_DataType[] input_types, string original_op, Tensorflow.OpDef op_def)
Tensorflow.Graph.create_op(string op_type, Tensorflow.Tensor[] inputs, Tensorflow.TF_DataType[] dtypes, Tensorflow.TF_DataType[] input_types, string name, System.Collections.Generic.Dictionary<string, Tensorflow.AttrValue> attrs, Tensorflow.OpDef op_def, bool compute_device)
Tensorflow.OpDefLibrary._apply_op_helper.AnonymousMethod__0(Tensorflow.ops.NameScope scope)
Tensorflow.Binding.tf_with<Tensorflow.ops.NameScope, Tensorflow.Operation>(Tensorflow.ops.NameScope py, System.Func<Tensorflow.ops.NameScope, Tensorflow.Operation> action)
Tensorflow.OpDefLibrary._apply_op_helper(string op_type_name, string name, System.Collections.Generic.Dictionary<string, object> keywords)
Tensorflow.Operations.gen_ops.left_shift(Tensorflow.Tensor x, Tensorflow.Tensor y, string name) Line 14611
TensorFlowBenchmark.Program.Main(string[] args) Line 18
Metadata
Metadata
Assignees
Labels
No labels
Activity
add tf.bitwise.left_shift unit test #614.
Oceania2018 commentedon Sep 6, 2020