Browse Source

tf2.0

pull/369/head
arnavdas88 6 years ago
parent
commit
36d96cadda
1 changed files with 25 additions and 0 deletions
  1. +25
    -0
      src/TensorFlowNET.Core/Binding.Util.cs

+ 25
- 0
src/TensorFlowNET.Core/Binding.Util.cs View File

@@ -333,5 +333,30 @@ namespace Tensorflow
return true; return true;
return false; return false;
} }
public static Dictionary<string, object> vars(object obj)
{
throw new NotImplementedException();
/*
var objProps = obj.GetType().GetProperties().Where(p => p.GetIndexParameters().Length == 0).ToArray();
var objProps_w_IndexParams = obj.GetType().GetProperties().Where(p => p.GetIndexParameters().Length != 0).ToArray();
var objFields = obj.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly);
var ret = new Dictionary<string, object>();
for(int i = 0; i < objProps.Length; i++)
ret.Add(objProps[i].Name, objProps[i].GetValue(obj));
for(int i = 0; i < objProps_w_IndexParams.Length; i++)
{
var objProp = objProps_w_IndexParams[i];
var objPropiParam = objProp.GetIndexParameters();
ret.Add(objProp.Name, objProp.GetValue(obj, new object[]{0}));
}
for(int i = 0; i < objFields.Length; i++)
ret.Add(objFields[i].Name, objFields[i].GetValue(obj));
return ret;
*/
}
public static long id(object obj)
{
return obj.GetHashCode();
}
} }
} }

Loading…
Cancel
Save