/// <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()); } }
public SafeStringTensorHandle(SafeTensorHandle handle, Shape shape) : base(handle.DangerousGetHandle()) { _tensorHandle = handle; _shape = shape; bool success = false; _tensorHandle.DangerousAddRef(ref success); }
public static extern SafeEagerTensorHandle TFE_NewTensorHandle(SafeTensorHandle t, SafeStatusHandle status);
public static extern void TF_SetAttrTensor(IntPtr desc, string attr_name, SafeTensorHandle value, SafeStatusHandle status);
public static extern long TF_Dim(SafeTensorHandle tensor, int dim_index);