|
1 | | -/***************************************************************************** |
2 | | - Copyright 2018 The TensorFlow.NET Authors. 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 | | - |
| 1 | +using NumSharp; |
17 | 2 | using System; |
| 3 | +using System.Collections.Generic; |
| 4 | +using System.Text; |
18 | 5 |
|
19 | 6 | namespace Tensorflow |
20 | 7 | { |
21 | 8 | public partial class Tensor |
22 | 9 | { |
23 | | - public static implicit operator Tensor(bool value) |
| 10 | + /// <summary> |
| 11 | + /// Issue unresolved, will cause name_scope problem. |
| 12 | + /// </summary> |
| 13 | + /// <param name="scalar"></param> |
| 14 | + /*public static implicit operator Tensor(double scalar) |
24 | 15 | { |
25 | | - return tf.constant(value, TF_DataType.TF_BOOL); |
26 | | - } |
27 | | - |
28 | | - public static implicit operator Tensor(sbyte value) |
29 | | - { |
30 | | - return tf.constant(value, TF_DataType.TF_INT8); |
31 | | - } |
32 | | - |
33 | | - public static implicit operator Tensor(byte value) |
34 | | - { |
35 | | - return tf.constant(value, TF_DataType.TF_INT16); |
36 | | - } |
37 | | - |
38 | | - public static implicit operator Tensor(ushort value) |
39 | | - { |
40 | | - return tf.constant(value, TF_DataType.TF_UINT16); |
41 | | - } |
42 | | - |
43 | | - public static implicit operator Tensor(short value) |
44 | | - { |
45 | | - return tf.constant(value, TF_DataType.TF_INT16); |
46 | | - } |
| 16 | + return constant_op.constant(scalar); |
| 17 | + }*/ |
47 | 18 |
|
48 | | - public static implicit operator Tensor(int value) |
| 19 | + /*public static implicit operator Tensor(int scalar) |
49 | 20 | { |
50 | | - return tf.constant(value, TF_DataType.TF_INT32); |
51 | | - } |
52 | | - |
53 | | - public static implicit operator Tensor(uint value) |
54 | | - { |
55 | | - return tf.constant(value, TF_DataType.TF_UINT32); |
56 | | - } |
57 | | - |
58 | | - public static implicit operator Tensor(long value) |
59 | | - { |
60 | | - return tf.constant(value, TF_DataType.TF_INT64); |
61 | | - } |
62 | | - |
63 | | - public static implicit operator Tensor(ulong value) |
64 | | - { |
65 | | - return tf.constant(value, TF_DataType.TF_UINT64); |
66 | | - } |
67 | | - |
68 | | - public static implicit operator Tensor(float value) |
69 | | - { |
70 | | - return tf.constant(value, TF_DataType.TF_FLOAT); |
71 | | - } |
72 | | - |
73 | | - public static implicit operator Tensor(double value) |
74 | | - { |
75 | | - return tf.constant(value, TF_DataType.TF_DOUBLE); |
76 | | - } |
| 21 | + return constant_op.constant(scalar); |
| 22 | + }*/ |
77 | 23 |
|
78 | 24 | public static implicit operator IntPtr(Tensor tensor) |
79 | 25 | { |
|
0 commit comments