/// <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());
     }
 }
Example #2
0
        public SafeStringTensorHandle(SafeTensorHandle handle, Shape shape)
            : base(handle.DangerousGetHandle())
        {
            _tensorHandle = handle;
            _shape        = shape;
            bool success = false;

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