示例#1
0
        /// <summary>
        /// Sets the shape of the Tensor referenced by <paramref name="output"/> in graph to
        /// the shape described by <paramref name="dims"/>.
        /// </summary>
        /// <param name="output">The output</param>
        /// <param name="dims">The shape</param>
        /// <param name="status">The status</param>
        public void SetTensorShape(Output output, int[] dims, Status status = null)
        {
            GCHandle handle = GCHandle.Alloc(dims, GCHandleType.Pinned);

            using (StatusChecker checker = new StatusChecker(status))
                TfInvoke.tfeGraphSetTensorShape(_ptr, output.Operation, output.Index, handle.AddrOfPinnedObject(), dims.Length, checker.Status);
        }