From patchwork Fri May 14 07:11:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27768 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp225038iof; Fri, 14 May 2021 00:42:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcLH6gG9M0ZRehAW2GOu4AQXvtf3HCJruG4VHJl6uwcnAU7wvTFc+Wa6KLddQ805e6XKZL X-Received: by 2002:a05:6402:254a:: with SMTP id l10mr55121521edb.145.1620978126814; Fri, 14 May 2021 00:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620978126; cv=none; d=google.com; s=arc-20160816; b=uT/DdShgwCj3Sw538ZAntPbIzF5fa0UrfXLX1o2a/rkizzuTdrgxmRgdeDQGic3syw B2Gg9AmjBFSJNWItjevR6GD7+uftoaqHhWo34Da11pkbUhfD6emZvyumR0jysNrVJ/Wc qN+pTIu9K8Zvc07m82rc1552/YhcUFnLd3Cb/gx2MjosyNTQom3EoDWmWwDKxIaEGEe8 rKBzvFD28NEezLH8bxD4s8Hbw62aphogS/0axuEJ0QAJGi8LZSG5L8HPRUXBzhSGaq4c t9mO15iIKPfs/d0ECBv5el6OOgevd/OH71oGB8A5//TtWz3DWovWJP5BK/eVMqVNgmDi 7aEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=DXs7S3CboZWGmjQysixlKbM+IUljcOGZXTc58wO6FTM=; b=sHr3wv/JxfB7q0lgv/MQlb7juejBlitADqwTntF5/lus2bvLbzJPw3IirjlnyiPvTF 0Rfh2+Y70KQOCyB+9Wz7JxAga9vW1uyuQPWCSwNr1OkitpBqCXQKLrjVUzglTGDD7hhj AVhuknR8+jiXok1O5jvuvnr2K63Fvia/0PfK2ER3wB0uKQnX/Wi1oFevsf09Kpk/y786 iXGRkmBw0gHePuoJqzIFBObv8I8r6QNmQcxk8xAc8IQfoLNKdq/22nFzecTBNkvTxeNe rrRA8NYJv8XrLDvVM32sDlM9TOG+tkbqLU2QnqVNBrSb/3sBuYsLhLHAag4hNLks4uWF QpcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GDqgUTuh; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d23si1169084edp.175.2021.05.14.00.42.06; Fri, 14 May 2021 00:42:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GDqgUTuh; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 40109680396; Fri, 14 May 2021 10:42:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B4B56808DA for ; Fri, 14 May 2021 10:41:56 +0300 (EEST) Received: by mail-oi1-f174.google.com with SMTP id v22so22855926oic.2 for ; Fri, 14 May 2021 00:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cvIoGy0dspQLpqmIRS/PJ2+KXIxeQ1+DwNsIQYCG/iM=; b=GDqgUTuh4ty4qT1kU3Z/uBiMphVKDdSNTsweS//bK8aBvUoFWhSJWHrzBrsISLPRXD Kaim47hfD7n0PL4GlrhSpa7MK39FqrRzh2V+HcAADoNfH6bKjyg0VaNtCKJJ48hzJYQ3 bbd8sNdlUL0a0sFH3EDxrQtOa07gvRNqERbulSY22Ovmwvpna4FOiBKr8eiDo78uocRQ cSoSGYPU5mBb3PxrS7KCYzU/MwJ7iULxzMYFqKz7N1dTj/eKiTRUoO678DNn98F0z8Sk LP/PfNuzp691BrDOrTfRbS/c+OteVC2gQQAuK79R+e8nTP+fWE3M/6KldSkUxDpS5vCO Dh7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cvIoGy0dspQLpqmIRS/PJ2+KXIxeQ1+DwNsIQYCG/iM=; b=Bpx6xgkpxhRqPjMcsG1zPd29y0mWfdOpjvJ3yEdUS9hmh1c35oJb+aqH4GGOx+7P/E DuzsYGVS2kWhhbJ5bPtSC1RDOGr7v5HoOhxXK2FkDZFOuFePSkQUFr1lRedE9WNXvZZT 9jVqWm6ugcEbapWhfqY5WTjGTFB0jqGqztM8YpW8eH0w4cIC/2QmNlHIjKu4HeO5cMWK 9MdCU/ucixCAHhbtNVovWY4FHicGDaIDHiUqUI0sqqq6OtDfVGXHis8PH0ydYg6bK0ZA qQzl9819MTpP2aEZvmL160sUj/F7hCeBdjRG9zLRZkKlnu5WAdqK5kHessNTgWxNfZ9z x2MQ== X-Gm-Message-State: AOAM530mfl5X/q7rZ1zB4ZG6J6XCXo+md1DRG+6wMY//01EP2er/6wtl OP2v2vImEjIaBwGzTtx6bVmwnfIrioernA== X-Received: by 2002:a17:90b:3b92:: with SMTP id pc18mr39671661pjb.218.1620976560362; Fri, 14 May 2021 00:16:00 -0700 (PDT) Received: from localhost.localdomain ([117.208.72.147]) by smtp.googlemail.com with ESMTPSA id p14sm4261627pjh.27.2021.05.14.00.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 00:16:00 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 May 2021 12:41:04 +0530 Message-Id: <20210514071104.23670-2-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514071104.23670-1-shubhanshu.e01@gmail.com> References: <20210514071104.23670-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V5 3/5] lavfi/dnn_backend_native_layer_dense.h: Documentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Shubhanshu Saxena Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0mKQcn2m8+k0 Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index 86248856ae..0488b03cc3 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_dense.h +++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h @@ -31,7 +31,34 @@ typedef struct DenseParams{ float *biases; } DenseParams; +/** + * @brief Load the Densely-Connected Layer. + * + * It assigns the densely connected layer with DenseParams + * after parsing from the model file context. + * + * @param layer pointer to the DNN layer instance + * @param model_file_context pointer to model file context + * @param file_size model file size to check if data is read + * correctly from the model file + * @param operands_num operand count of the whole model to + * check if data is read correctly from the model file + * @return number of bytes read from the model file + * @retval 0 if out of memory or an error occurs + */ int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Densely-Connected Layer. + * + * @param operands all operands for the model + * @param input_operand_indexes input operand indexes for this layer + * @param output_operand_index output operand index for this layer + * @param parameters dense layer parameters + * @param ctx pointer to Native model context for logging + * @retval 0 if the execution succeeds + * @retval DNN_ERROR if the execution fails + */ int ff_dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx); #endif