|
| 1 | +/***************************************************************************** |
| 2 | + Copyright 2020 Haiping Chen. All Rights Reserved. |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +******************************************************************************/ |
| 16 | + |
| 17 | +using System; |
| 18 | +using System.Collections.Generic; |
| 19 | +using System.Text; |
| 20 | +using static Tensorflow.Binding; |
| 21 | + |
| 22 | +namespace Tensorflow.Operations |
| 23 | +{ |
| 24 | + public class bitwise_ops |
| 25 | + { |
| 26 | + /// <summary> |
| 27 | + /// Elementwise computes the bitwise left-shift of `x` and `y`. |
| 28 | + /// https://www.tensorflow.org/api_docs/python/tf/bitwise/left_shift |
| 29 | + /// </summary> |
| 30 | + /// <param name="x"></param> |
| 31 | + /// <param name="y"></param> |
| 32 | + /// <param name="name"></param> |
| 33 | + /// <returns></returns> |
| 34 | + public Tensor left_shift(Tensor x, Tensor y, string name = null) |
| 35 | + { |
| 36 | + if (tf.Context.executing_eagerly()) |
| 37 | + { |
| 38 | + var results = tf.Runner.TFE_FastPathExecute(tf.Context, tf.Context.DeviceName, |
| 39 | + "LeftShift", name, |
| 40 | + null, |
| 41 | + x, y); |
| 42 | + |
| 43 | + return results[0]; |
| 44 | + } |
| 45 | + |
| 46 | + var _op = tf.OpDefLib._apply_op_helper("LeftShift", name, args: new { x, y }); |
| 47 | + return _op.output; |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments