From patchwork Sat May 8 12:10:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27697 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp1362224iof; Sat, 8 May 2021 05:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjVepw0IklLxQiIkGUwc9lcZPs1qw8++/zxiTZqaCI5WLNAyHJjnt7uo6XurIhbFIxy7tL X-Received: by 2002:a17:907:372:: with SMTP id rs18mr15471744ejb.431.1620476334027; Sat, 08 May 2021 05:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620476334; cv=none; d=google.com; s=arc-20160816; b=qCIK9asB8KbZWh2iMTXTv6no6lKVnN0nVwFhDF2NCWDO3XCW1rh2C05YVTBUMO3Z8j 12J7L6TajRgZumH47D9ITjVEYoNrM2az4QOQBJqzvoHcHHL5vE3xOmtxU+jGhCF5XyGk XyoMEoWwAJM8dpojVH9jMsL1sYhKYLpES+Vqy2VHVHjhRSu4Q4jy4C84E8UAuAZnGjDz j0/rN8bNm3FObInqeD3UhupNFeQ2O60WvJ0LX/ZvMFj2PRBK9uSfc1dr2fiYSBlkWvgj 2i40cmVtf0v46BXLYwvGfy6fRrEByd3czPSAYQbGwZZQbs8khmD80eCLpTt7htPgLnI+ gm/g== 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=a72cuhDFKZ8+vYpXK9oyElo8khtRBx1idS/by/FOJ78=; b=DWAupwbWjKif6JWhqCJ+d+RiHzwjw2WcptRSuRBrx+KOEG9iRHFD0NJT1WX7IYp6oX Syp1l7r8cEth3izFvGn2iC9qHOp9vUmX4BPExT9LMQjxz4dGF6E42to4IPt+B2mIQgsB ktXEOn09F+ku5ZWmq2Q7RSjWqFEYqG7h2WSCS7EpoPHylWpgDigUkhOp5Il8Er2+UOxL MzQM/87L/Ug03z6Hlm1gCybvIHVXsQUYl1ug8sLQUrphFNP74YHw5uyx8Ruv2cGPhZQ9 e5liLLGzhxci3WrKY+Ts6CbK5nxcPXkMTb3LYNFfXXxVEDG3CGZ9io8E4fHfmRKxkqW2 xXng== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=hiEYSTrJ; 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 h3si7850912edw.187.2021.05.08.05.18.53; Sat, 08 May 2021 05:18:54 -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=hiEYSTrJ; 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 DF2396808A0; Sat, 8 May 2021 15:18:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC144680524 for ; Sat, 8 May 2021 15:18:44 +0300 (EEST) Received: by mail-pf1-f174.google.com with SMTP id b21so2693050pft.10 for ; Sat, 08 May 2021 05:18:44 -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=jlI3+5tNlZK4l3JflWChKBSFbvtzYg+EHZjNxo4ON5I=; b=hiEYSTrJu/f9sYl65i55MyG9hrcZJJ2qd5J5GB/dFkSow0Ds6K6KeO+sMfR98aRE9v mJJVA34prR47cLHmPG/2Q4A4MBrW2g8+i+vjsYjwg9ifDZfJLmJJ2BaQ0aonrhSl74cj aXqyIU+e3Bw9Szw74xxs26wbCYcgL6tHf8rDwawE4FGLlHnS+wM/c7BiXqqmi8lF1DD1 pyc+qUHJwy1fExOEPz1He+sV2h42Nf43lMBFf05YPO/tgXxoffOt9I0IrHoPff8Hrnau YGoas0LTowGUTnWyABLTtW+lpf305Y6awz2Q2QavlDgaO6y8lqhBQaUpEzanvySBaShB 68rw== 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=jlI3+5tNlZK4l3JflWChKBSFbvtzYg+EHZjNxo4ON5I=; b=oj0uifQAg1Slzi08aga/KpzfDZlzncBSe7CVYIc4FPMvEdB5hhYqQv8LrCNzEyy65C kWG15FUTU+Oj26uJMRAQn4KlBtGQww44ROPmhhBRIKg+1PowtOF6FTihKJEJgg5NJpUN wNGXQ+6uR+62ijH4xsUmPWnY0psRr1/VlKN0FrD2EfUaSwpmNWj/0SXSqeMLwzHjXRmT lkPzPBurtj99Xk6dhjEk4Mm5lWbaVwShqxRudpd2Qn+0tK7/kRs6jGP56vDRgGi72YwN zN4GXCC2T5vvIZjA/alv8uDgq5EUpD2Qr8Nc+pq/6u265dih9OEMht4TnCQGf5IVb0Yz Y0Yw== X-Gm-Message-State: AOAM532PRUQc3bCVjnOIOaoXkvcSLJ7JxF4zojAnZTsjb0DOnJaPBvk4 bTK6HzchQl3TAT7AuCCiZVH3+RH1b4QUbg== X-Received: by 2002:a62:1591:0:b029:2a8:b819:6341 with SMTP id 139-20020a6215910000b02902a8b8196341mr7594118pfv.73.1620475900175; Sat, 08 May 2021 05:11:40 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.139]) by smtp.googlemail.com with ESMTPSA id j3sm7052216pfr.30.2021.05.08.05.11.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 05:11:39 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 May 2021 17:40:15 +0530 Message-Id: <20210508121016.12413-3-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210508121016.12413-1-shubhanshu.e01@gmail.com> References: <20210508121016.12413-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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: Qznubtv07g0c Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index 86248856ae..fc971cece2 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_dense.h +++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h @@ -31,7 +31,33 @@ typedef struct DenseParams{ float *biases; } DenseParams; +/** + * @brief Load the Densely-Connnected Layer. + * + * It assigns the layer parameters to the hyperparameters + * like activation, bias, and kernel size 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 + * @param operands_num number of operands for the layer + * @return Size of DNN Layer + * @retval 0 if model file context contains invalid hyperparameters. + */ int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Densely-Connnected Layer. + * + * @param operands input operands + * @param input_operand_indexes input operand indexes + * @param output_operand_index output operand index + * @param parameters layer parameters + * @param ctx pointer to Native model context + * @retval DNN_SUCCESS 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