Exemplo n.º 1
0
 /// <summary>
 ///     Create a Tensor object from an existing TF handle
 /// </summary>
 /// <param name="handle">Handle to a <see cref="Tensor"/> object.</param>
 public unsafe Tensor(SafeTensorHandle handle, bool clone = false)
 {
     _handle = handle;
     if (clone && handle != null)
     {
         _handle = TF_NewTensor(shape, dtype, data: TensorDataPointer.ToPointer());
     }
 }
Exemplo n.º 2
0
        public SafeStringTensorHandle(SafeTensorHandle handle, Shape shape)
            : base(handle.DangerousGetHandle())
        {
            _tensorHandle = handle;
            _shape        = shape;
            bool success = false;

            _tensorHandle.DangerousAddRef(ref success);
        }
Exemplo n.º 3
0
 public static extern SafeEagerTensorHandle TFE_NewTensorHandle(SafeTensorHandle t, SafeStatusHandle status);
Exemplo n.º 4
0
 public static extern void TF_SetAttrTensor(IntPtr desc, string attr_name, SafeTensorHandle value, SafeStatusHandle status);
Exemplo n.º 5
0
 public static extern long TF_Dim(SafeTensorHandle tensor, int dim_index);