tvm
Namespaces | Functions
nn.h File Reference

NN op constructions. More...

#include <tvm/arith/analyzer.h>
#include <tvm/te/operation.h>
#include <tvm/tir/expr.h>
#include <tvm/tir/op.h>
#include <tvm/topi/detail/constant_utils.h>
#include <tvm/topi/reduction.h>
#include <tvm/topi/tags.h>
#include <tvm/topi/transform.h>
#include <algorithm>
#include <string>
Include dependency graph for nn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::topi
 

Functions

template<typename T >
tvm::te::Tensor tvm::topi::relu (const tvm::te::Tensor &t, T threshold=static_cast< T >(0), std::string name="T_relu", std::string tag=kElementWise)
 Creates an operation that performs a rectified linear unit. More...
 
tvm::te::Tensor tvm::topi::leaky_relu (const tvm::te::Tensor &t, double alpha=0.1, std::string name="T_leaky_relu", std::string tag=kElementWise)
 Creates an operation that performs a leaky rectified linear unit. More...
 
tvm::te::Tensor tvm::topi::prelu (const tvm::te::Tensor &x, const tvm::te::Tensor &slope, const int axis=1, std::string name="T_prelu", std::string tag=kBroadcast)
 Creates an operation that performs a parametric rectified linear unit. More...
 
tvm::te::Tensor tvm::topi::pad (const tvm::te::Tensor &t, const tvm::Array< tvm::PrimExpr > &pad_before, tvm::Array< tvm::PrimExpr > pad_after=tvm::Array< tvm::PrimExpr >(), PrimExpr pad_value=PrimExpr(), std::string name="T_pad", std::string tag=kElementWise, std::string pad_mode="constant", const Array< PrimExpr > *dyn_output_shape=nullptr)
 Creates an operation that performs padding. More...
 
tvm::te::Tensor tvm::topi::conv2d_nchw (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_conv2d_nchw", std::string tag=kConv2dNCHW)
 Creates an operation that performs a 2-D convolution with an NCHW-layout. More...
 
tvm::te::Tensor tvm::topi::conv2d_hwcn (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_conv2d_hwcn", std::string tag=kConv2dHWCN)
 Creates an operation for 2-D convolution layer with an HWCN-layout. More...
 
tvm::te::Tensor tvm::topi::depthwise_conv2d_nchw (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_depthwise_conv2d_nchw", std::string tag=kDepthwiseConv2dNCHW)
 Creates an operation that performs a 2-D depthwise convolution with an NCHW-layout. More...
 
tvm::te::Tensor tvm::topi::depthwise_conv2d_nhwc (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_depthwise_conv2d_nhwc", std::string tag=kDepthwiseConv2dNHWC)
 
tvm::te::Tensor tvm::topi::group_conv2d_ngchw (const tvm::te::Tensor &I, const tvm::te::Tensor &W, int pad_h=0, int pad_w=0, int stride_h=1, int stride_w=1, std::string name="T_group_conv2d_ngchw", std::string tag=kGroupConv2d)
 Creates an operation that performs a 2-D group convolution with an NGCHW-layout. More...
 
tvm::te::Tensor tvm::topi::space_to_batch_nd (const tvm::te::Tensor &data, const tvm::Array< Integer > &block_shape, const tvm::Array< tvm::PrimExpr > &pad_before, const tvm::Array< tvm::PrimExpr > &pad_after, PrimExpr pad_value=PrimExpr(), std::string name="space_to_batch_nd", std::string tag=kInjective)
 Divide spatial dimensions of the input into a grid of blocks. More...
 
tvm::te::Tensor tvm::topi::batch_to_space_nd (const tvm::te::Tensor &data, const tvm::Array< Integer > &block_shape, const tvm::Array< tvm::PrimExpr > &crop_begin_list, const tvm::Array< tvm::PrimExpr > &crop_end_list, std::string name="batch_to_space_nd", std::string tag=kInjective)
 Reshape the batch dimension into spatial dimensions. More...
 
Tensor tvm::topi::nll_loss (const Tensor &predictions, const Tensor &targets, const Tensor &weights, std::string reduction="mean", int ignore_index=-100, const std::string name="nll_loss", const std::string tag=kBroadcast)
 Negative log likelihood loss. More...
 

Detailed Description

NN op constructions.