未验证 提交 baec0a07 编写于 作者: X XiaoguangHu 提交者: GitHub

define alias in paddle dir and paddle.nn dir test=develop (#23282)

* define alias in paddle dir and paddle.nn dir test=develop

* define alias in paddle.nn.functional dir test=develop

* define alias in paddle.tensor.__init__.py test=develop
上级 babda94c
...@@ -33,3 +33,189 @@ import paddle.compat ...@@ -33,3 +33,189 @@ import paddle.compat
import paddle.distributed import paddle.distributed
batch = batch.batch batch = batch.batch
import paddle.sysconfig import paddle.sysconfig
#TODO: define alias in tensor and framework directory
# from .tensor.creation import create_.tensor #DEFINE_ALIAS
# from .tensor.creation import create_lod_.tensor #DEFINE_ALIAS
# from .tensor.creation import create_random_int_lod.tensor #DEFINE_ALIAS
# from .tensor.creation import crop_.tensor #DEFINE_ALIAS
# from .tensor.creation import diag #DEFINE_ALIAS
# from .tensor.creation import eye #DEFINE_ALIAS
# from .tensor.creation import fill_constant #DEFINE_ALIAS
# from .tensor.creation import get_.tensor_from_selected_rows #DEFINE_ALIAS
# from .tensor.creation import linspace #DEFINE_ALIAS
# from .tensor.creation import ones #DEFINE_ALIAS
# from .tensor.creation import ones_like #DEFINE_ALIAS
# from .tensor.creation import range #DEFINE_ALIAS
# from .tensor.creation import zeros #DEFINE_ALIAS
# from .tensor.creation import zeros_like #DEFINE_ALIAS
# from .tensor.creation import arrange #DEFINE_ALIAS
# from .tensor.creation import eye #DEFINE_ALIAS
# from .tensor.creation import full #DEFINE_ALIAS
# from .tensor.creation import linspace #DEFINE_ALIAS
# from .tensor.creation import full_like #DEFINE_ALIAS
# from .tensor.creation import triu #DEFINE_ALIAS
# from .tensor.creation import tril #DEFINE_ALIAS
# from .tensor.creation import meshgrid #DEFINE_ALIAS
# from .tensor.stat import mean #DEFINE_ALIAS
# from .tensor.stat import reduce_mean #DEFINE_ALIAS
# from .tensor.stat import std #DEFINE_ALIAS
# from .tensor.stat import var #DEFINE_ALIAS
# from .tensor.logic import equal #DEFINE_ALIAS
# from .tensor.logic import greater_equal #DEFINE_ALIAS
# from .tensor.logic import greater_than #DEFINE_ALIAS
# from .tensor.logic import is_empty #DEFINE_ALIAS
# from .tensor.logic import isfinite #DEFINE_ALIAS
# from .tensor.logic import less_equal #DEFINE_ALIAS
# from .tensor.logic import less_than #DEFINE_ALIAS
# from .tensor.logic import logical_and #DEFINE_ALIAS
# from .tensor.logic import logical_not #DEFINE_ALIAS
# from .tensor.logic import logical_or #DEFINE_ALIAS
# from .tensor.logic import logical_xor #DEFINE_ALIAS
# from .tensor.logic import not_equal #DEFINE_ALIAS
# from .tensor.logic import reduce_all #DEFINE_ALIAS
# from .tensor.logic import reduce_any #DEFINE_ALIAS
# from .tensor.logic import allclose #DEFINE_ALIAS
# from .tensor.logic import elementwise_equal #DEFINE_ALIAS
# from .tensor.logic import isnan #DEFINE_ALIAS
# from .tensor..tensor import Tensor #DEFINE_ALIAS
# from .tensor..tensor import LoDTensor #DEFINE_ALIAS
# from .tensor..tensor import LoDTensorArray #DEFINE_ALIAS
# from .tensor.random import gaussin #DEFINE_ALIAS
# from .tensor.random import uniform #DEFINE_ALIAS
# from .tensor.random import shuffle #DEFINE_ALIAS
# from .tensor.random import randn #DEFINE_ALIAS
# from .tensor.random import randperm #DEFINE_ALIAS
# from .tensor.random import rand #DEFINE_ALIAS
# from .tensor.random import randint #DEFINE_ALIAS
# from .tensor.math import abs #DEFINE_ALIAS
# from .tensor.math import acos #DEFINE_ALIAS
# from .tensor.math import asin #DEFINE_ALIAS
# from .tensor.math import atan #DEFINE_ALIAS
# from .tensor.math import ceil #DEFINE_ALIAS
# from .tensor.math import cos #DEFINE_ALIAS
# from .tensor.math import cumsum #DEFINE_ALIAS
# from .tensor.math import elementwise_add #DEFINE_ALIAS
# from .tensor.math import elementwise_div #DEFINE_ALIAS
# from .tensor.math import elementwise_floordiv #DEFINE_ALIAS
# from .tensor.math import elementwise_max #DEFINE_ALIAS
# from .tensor.math import elementwise_min #DEFINE_ALIAS
# from .tensor.math import elementwise_mod #DEFINE_ALIAS
# from .tensor.math import elementwise_mul #DEFINE_ALIAS
# from .tensor.math import elementwise_pow #DEFINE_ALIAS
# from .tensor.math import elementwise_sub #DEFINE_ALIAS
# from .tensor.math import exp #DEFINE_ALIAS
# from .tensor.math import floor #DEFINE_ALIAS
# from .tensor.math import increment #DEFINE_ALIAS
# from .tensor.math import log #DEFINE_ALIAS
# from .tensor.math import mul #DEFINE_ALIAS
# from .tensor.math import multiplex #DEFINE_ALIAS
# from .tensor.math import pow #DEFINE_ALIAS
# from .tensor.math import reciprocal #DEFINE_ALIAS
# from .tensor.math import reduce_max #DEFINE_ALIAS
# from .tensor.math import reduce_min #DEFINE_ALIAS
# from .tensor.math import reduce_prod #DEFINE_ALIAS
# from .tensor.math import reduce_sum #DEFINE_ALIAS
# from .tensor.math import round #DEFINE_ALIAS
# from .tensor.math import rsqrt #DEFINE_ALIAS
# from .tensor.math import scale #DEFINE_ALIAS
# from .tensor.math import sign #DEFINE_ALIAS
# from .tensor.math import sin #DEFINE_ALIAS
# from .tensor.math import sqrt #DEFINE_ALIAS
# from .tensor.math import square #DEFINE_ALIAS
# from .tensor.math import stanh #DEFINE_ALIAS
# from .tensor.math import sum #DEFINE_ALIAS
# from .tensor.math import sums #DEFINE_ALIAS
# from .tensor.math import tanh #DEFINE_ALIAS
# from .tensor.math import elementwise_sum #DEFINE_ALIAS
# from .tensor.math import max #DEFINE_ALIAS
# from .tensor.math import min #DEFINE_ALIAS
# from .tensor.math import mm #DEFINE_ALIAS
# from .tensor.math import div #DEFINE_ALIAS
# from .tensor.math import add #DEFINE_ALIAS
# from .tensor.math import atan #DEFINE_ALIAS
# from .tensor.math import logsumexp #DEFINE_ALIAS
# from .tensor.math import inverse #DEFINE_ALIAS
# from .tensor.math import log1p #DEFINE_ALIAS
# from .tensor.math import erf #DEFINE_ALIAS
# from .tensor.math import addcmul #DEFINE_ALIAS
# from .tensor.math import addmm #DEFINE_ALIAS
# from .tensor.attribute import rank #DEFINE_ALIAS
# from .tensor.attribute import shape #DEFINE_ALIAS
# from .tensor.io import save #DEFINE_ALIAS
# from .tensor.io import load #DEFINE_ALIAS
# from .tensor.linalg import matmul #DEFINE_ALIAS
# from .tensor.linalg import dot #DEFINE_ALIAS
# from .tensor.linalg import einsum #DEFINE_ALIAS
# from .tensor.linalg import morm #DEFINE_ALIAS
# from .tensor.linalg import transpose #DEFINE_ALIAS
# from .tensor.linalg import dist #DEFINE_ALIAS
# from .tensor.linalg import t #DEFINE_ALIAS
# from .tensor.linalg import cross #DEFINE_ALIAS
# from .tensor.linalg import cholesky #DEFINE_ALIAS
# from .tensor.linalg import .tensordot #DEFINE_ALIAS
# from .tensor.manipulation import cast #DEFINE_ALIAS
# from .tensor.manipulation import concat #DEFINE_ALIAS
# from .tensor.manipulation import expand #DEFINE_ALIAS
# from .tensor.manipulation import expand_as #DEFINE_ALIAS
# from .tensor.manipulation import flatten #DEFINE_ALIAS
# from .tensor.manipulation import gather #DEFINE_ALIAS
# from .tensor.manipulation import gather_nd #DEFINE_ALIAS
# from .tensor.manipulation import reshape #DEFINE_ALIAS
# from .tensor.manipulation import reverse #DEFINE_ALIAS
# from .tensor.manipulation import scatter #DEFINE_ALIAS
# from .tensor.manipulation import scatter_nd_add #DEFINE_ALIAS
# from .tensor.manipulation import scatter_nd #DEFINE_ALIAS
# from .tensor.manipulation import shard_index #DEFINE_ALIAS
# from .tensor.manipulation import slice #DEFINE_ALIAS
# from .tensor.manipulation import split #DEFINE_ALIAS
# from .tensor.manipulation import squeeze #DEFINE_ALIAS
# from .tensor.manipulation import stack #DEFINE_ALIAS
# from .tensor.manipulation import strided_slice #DEFINE_ALIAS
# from .tensor.manipulation import transpose #DEFINE_ALIAS
# from .tensor.manipulation import unique #DEFINE_ALIAS
# from .tensor.manipulation import unique_with_counts #DEFINE_ALIAS
# from .tensor.manipulation import unsqueeze #DEFINE_ALIAS
# from .tensor.manipulation import unstack #DEFINE_ALIAS
# from .tensor.manipulation import flip #DEFINE_ALIAS
# from .tensor.manipulation import unbind #DEFINE_ALIAS
# from .tensor.manipulation import roll #DEFINE_ALIAS
# from .tensor.search import argmax #DEFINE_ALIAS
# from .tensor.search import argmin #DEFINE_ALIAS
# from .tensor.search import argsort #DEFINE_ALIAS
# from .tensor.search import has_inf #DEFINE_ALIAS
# from .tensor.search import has_nan #DEFINE_ALIAS
# from .tensor.search import masked_select #DEFINE_ALIAS
# from .tensor.search import topk #DEFINE_ALIAS
# from .tensor.search import where #DEFINE_ALIAS
# from .tensor.search import index_select #DEFINE_ALIAS
# from .tensor.search import nonzero #DEFINE_ALIAS
# from .tensor.search import sort #DEFINE_ALIAS
# from .framework.framework import set_default_dtype #DEFINE_ALIAS
# from .framework.framework import get_default_dtype #DEFINE_ALIAS
# from .framework.random import manual_seed #DEFINE_ALIAS
# from .framework import append_backward #DEFINE_ALIAS
# from .framework import gradients #DEFINE_ALIAS
# from .framework import Executor #DEFINE_ALIAS
# from .framework import global_scope #DEFINE_ALIAS
# from .framework import scope_guard #DEFINE_ALIAS
# from .framework import BuildStrategy #DEFINE_ALIAS
# from .framework import CompiledProgram #DEFINE_ALIAS
# from .framework import default_main_program #DEFINE_ALIAS
# from .framework import default_startup_program #DEFINE_ALIAS
# from .framework import create_global_var #DEFINE_ALIAS
# from .framework import create_parameter #DEFINE_ALIAS
# from .framework import create_py_reader_by_data #DEFINE_ALIAS
# from .framework import Print #DEFINE_ALIAS
# from .framework import py_func #DEFINE_ALIAS
# from .framework import ExecutionStrategy #DEFINE_ALIAS
# from .framework import in_dygraph_mode #DEFINE_ALIAS
# from .framework import name_scope #DEFINE_ALIAS
# from .framework import ParallelExecutor #DEFINE_ALIAS
# from .framework import ParamAttr #DEFINE_ALIAS
# from .framework import Program #DEFINE_ALIAS
# from .framework import program_guard #DEFINE_ALIAS
# from .framework import Variable #DEFINE_ALIAS
# from .framework import WeightNormParamAttr #DEFINE_ALIAS
# from .framework import Model #DEFINE_ALIAS
# from .framework import Sequential #DEFINE_ALIAS
...@@ -15,3 +15,243 @@ ...@@ -15,3 +15,243 @@
# TODO: import all neural network related api under this directory, # TODO: import all neural network related api under this directory,
# including layers, linear, conv, rnn etc. # including layers, linear, conv, rnn etc.
# __all__ = [ ] # __all__ = [ ]
# TODO: define alias in nn directory
# from .clip import ErrorClipByValue #DEFINE_ALIAS
# from .clip import GradientClipByGlobalNorm #DEFINE_ALIAS
# from .clip import GradientClipByNorm #DEFINE_ALIAS
# from .clip import GradientClipByValue #DEFINE_ALIAS
# from .clip import set_gradient_clip #DEFINE_ALIAS
# from .clip import clip #DEFINE_ALIAS
# from .clip import clip_by_norm #DEFINE_ALIAS
# from .initalizer import Bilinear #DEFINE_ALIAS
# from .initalizer import Constant #DEFINE_ALIAS
# from .initalizer import MSRA #DEFINE_ALIAS
# from .initalizer import Normal #DEFINE_ALIAS
# from .initalizer import TruncatedNormal #DEFINE_ALIAS
# from .initalizer import Uniform #DEFINE_ALIAS
# from .initalizer import Xavier #DEFINE_ALIAS
# from .decode import BeamSearchDecoder #DEFINE_ALIAS
# from .decode import Decoder #DEFINE_ALIAS
# from .decode import beam_search #DEFINE_ALIAS
# from .decode import beam_search_decode #DEFINE_ALIAS
# from .decode import crf_decoding #DEFINE_ALIAS
# from .decode import ctc_greedy_decoder #DEFINE_ALIAS
# from .decode import dynamic_decode #DEFINE_ALIAS
# from .decode import gather_tree #DEFINE_ALIAS
# from .bin.conv import 0 #DEFINE_ALIAS
# from .control_flow import case #DEFINE_ALIAS
# from .control_flow import cond #DEFINE_ALIAS
# from .control_flow import DynamicRNN #DEFINE_ALIAS
# from .control_flow import StaticRNN #DEFINE_ALIAS
# from .control_flow import switch_case #DEFINE_ALIAS
# from .control_flow import while_loop #DEFINE_ALIAS
# from .control_flow import rnn #DEFINE_ALIAS
# from .layer.conv import Conv2D #DEFINE_ALIAS
# from .layer.conv import Conv2DTranspose #DEFINE_ALIAS
# from .layer.conv import Conv3D #DEFINE_ALIAS
# from .layer.conv import Conv3DTranspose #DEFINE_ALIAS
# from .layer.conv import TreeConv #DEFINE_ALIAS
# from .layer.conv import Conv1D #DEFINE_ALIAS
# from .layer.loss import NCELoss #DEFINE_ALIAS
# from .layer.loss import CrossEntropyLoss #DEFINE_ALIAS
# from .layer.loss import MSELoss #DEFINE_ALIAS
# from .layer.loss import L1Loss #DEFINE_ALIAS
# from .layer.loss import NLLLoss #DEFINE_ALIAS
# from .layer.loss import BCELoss #DEFINE_ALIAS
# from .layer.learning_rate import CosineDecay #DEFINE_ALIAS
# from .layer.learning_rate import ExponentialDecay #DEFINE_ALIAS
# from .layer.learning_rate import InverseTimeDecay #DEFINE_ALIAS
# from .layer.learning_rate import NaturalExpDecay #DEFINE_ALIAS
# from .layer.learning_rate import NoamDecay #DEFINE_ALIAS
# from .layer.learning_rate import PiecewiseDecay #DEFINE_ALIAS
# from .layer.learning_rate import PolynomialDecay #DEFINE_ALIAS
# from .layer.transformer import #DEFINE_ALIAS
# from .layer.norm import BatchNorm #DEFINE_ALIAS
# from .layer.norm import GroupNorm #DEFINE_ALIAS
# from .layer.norm import LayerNorm #DEFINE_ALIAS
# from .layer.norm import SpectralNorm #DEFINE_ALIAS
# from .layer.activation import PReLU #DEFINE_ALIAS
# from .layer.activation import ReLU #DEFINE_ALIAS
# from .layer.activation import Sigmoid #DEFINE_ALIAS
# from .layer.activation import Softmax #DEFINE_ALIAS
# from .layer.activation import LogSoftmax #DEFINE_ALIAS
# from .layer.rnn import RNNCell #DEFINE_ALIAS
# from .layer.rnn import GRUCell #DEFINE_ALIAS
# from .layer.rnn import LSTMCell #DEFINE_ALIAS
# from .layer.common import BilinearTensorProduct #DEFINE_ALIAS
# from .layer.common import Pool2D #DEFINE_ALIAS
# from .layer.common import Embedding #DEFINE_ALIAS
# from .layer.common import Linear #DEFINE_ALIAS
# from .layer.common import UpSample #DEFINE_ALIAS
# from .functional.conv import conv2d #DEFINE_ALIAS
# from .functional.conv import conv2d_transpose #DEFINE_ALIAS
# from .functional.conv import conv3d #DEFINE_ALIAS
# from .functional.conv import conv3d_transpose #DEFINE_ALIAS
# from .functional.loss import bpr_loss #DEFINE_ALIAS
# from .functional.loss import center_loss #DEFINE_ALIAS
# from .functional.loss import cross_entropy #DEFINE_ALIAS
# from .functional.loss import dice_loss #DEFINE_ALIAS
# from .functional.loss import edit_distance #DEFINE_ALIAS
# from .functional.loss import huber_loss #DEFINE_ALIAS
# from .functional.loss import iou_similarity #DEFINE_ALIAS
# from .functional.loss import kldiv_loss #DEFINE_ALIAS
# from .functional.loss import log_loss #DEFINE_ALIAS
# from .functional.loss import margin_rank_loss #DEFINE_ALIAS
# from .functional.loss import mse_loss #DEFINE_ALIAS
# from .functional.loss import nce #DEFINE_ALIAS
# from .functional.loss import npair_loss #DEFINE_ALIAS
# from .functional.loss import rank_loss #DEFINE_ALIAS
# from .functional.loss import sampled_softmax_with_cross_entropy #DEFINE_ALIAS
# from .functional.loss import sigmoid_cross_entropy_with_logits #DEFINE_ALIAS
# from .functional.loss import sigmoid_focal_loss #DEFINE_ALIAS
# from .functional.loss import smooth_l1 #DEFINE_ALIAS
# from .functional.loss import softmax_with_cross_entropy #DEFINE_ALIAS
# from .functional.loss import square_error_cost #DEFINE_ALIAS
# from .functional.loss import ssd_loss #DEFINE_ALIAS
# from .functional.loss import teacher_student_sigmoid_loss #DEFINE_ALIAS
# from .functional.learning_rate import cosine_decay #DEFINE_ALIAS
# from .functional.learning_rate import exponential_decay #DEFINE_ALIAS
# from .functional.learning_rate import inverse_time_decay #DEFINE_ALIAS
# from .functional.learning_rate import natural_exp_decay #DEFINE_ALIAS
# from .functional.learning_rate import noam_decay #DEFINE_ALIAS
# from .functional.learning_rate import piecewise_decay #DEFINE_ALIAS
# from .functional.learning_rate import polynomial_decay #DEFINE_ALIAS
# from .functional.learning_rate import linear_lr_warmup #DEFINE_ALIAS
# from .functional.transformer import #DEFINE_ALIAS
# from .functional.pooling import pool2d #DEFINE_ALIAS
# from .functional.pooling import pool3d #DEFINE_ALIAS
# from .functional.pooling import adaptive_pool2d #DEFINE_ALIAS
# from .functional.pooling import adaptive_pool3d #DEFINE_ALIAS
# from .functional.norm import batch_norm #DEFINE_ALIAS
# from .functional.norm import data_norm #DEFINE_ALIAS
# from .functional.norm import group_norm #DEFINE_ALIAS
# from .functional.norm import instance_norm #DEFINE_ALIAS
# from .functional.norm import l2_normalize #DEFINE_ALIAS
# from .functional.norm import layer_norm #DEFINE_ALIAS
# from .functional.norm import lrn #DEFINE_ALIAS
# from .functional.norm import spectral_norm #DEFINE_ALIAS
# from .functional.vision import affine_channel #DEFINE_ALIAS
# from .functional.vision import affine_grid #DEFINE_ALIAS
# from .functional.vision import anchor_generator #DEFINE_ALIAS
# from .functional.vision import bipartite_match #DEFINE_ALIAS
# from .functional.vision import box_clip #DEFINE_ALIAS
# from .functional.vision import box_coder #DEFINE_ALIAS
# from .functional.vision import box_decoder_and_assign #DEFINE_ALIAS
# from .functional.vision import collect_fpn_proposals #DEFINE_ALIAS
# from .functional.vision import deformable_conv #DEFINE_ALIAS
# from .functional.vision import deformable_roi_pooling #DEFINE_ALIAS
# from .functional.vision import density_prior_box #DEFINE_ALIAS
# from .functional.vision import detection_output #DEFINE_ALIAS
# from .functional.vision import distribute_fpn_proposals #DEFINE_ALIAS
# from .functional.vision import fsp_matrix #DEFINE_ALIAS
# from .functional.vision import generate_mask_labels #DEFINE_ALIAS
# from .functional.vision import generate_proposal_labels #DEFINE_ALIAS
# from .functional.vision import generate_proposals #DEFINE_ALIAS
# from .functional.vision import grid_sampler #DEFINE_ALIAS
# from .functional.vision import image_resize #DEFINE_ALIAS
# from .functional.vision import image_resize_short #DEFINE_ALIAS
# from .functional.vision import multi_box_head #DEFINE_ALIAS
# from .functional.vision import pixel_shuffle #DEFINE_ALIAS
# from .functional.vision import prior_box #DEFINE_ALIAS
# from .functional.vision import prroi_pool #DEFINE_ALIAS
# from .functional.vision import psroi_pool #DEFINE_ALIAS
# from .functional.vision import resize_bilinear #DEFINE_ALIAS
# from .functional.vision import resize_nearest #DEFINE_ALIAS
# from .functional.vision import resize_trilinear #DEFINE_ALIAS
# from .functional.vision import retinanet_detection_output #DEFINE_ALIAS
# from .functional.vision import retinanet_target_assign #DEFINE_ALIAS
# from .functional.vision import roi_align #DEFINE_ALIAS
# from .functional.vision import roi_perspective_transform #DEFINE_ALIAS
# from .functional.vision import roi_pool #DEFINE_ALIAS
# from .functional.vision import shuffle_channel #DEFINE_ALIAS
# from .functional.vision import space_to_depth #DEFINE_ALIAS
# from .functional.vision import yolo_box #DEFINE_ALIAS
# from .functional.vision import yolov3_loss #DEFINE_ALIAS
# from .functional.activation import brelu #DEFINE_ALIAS
# from .functional.activation import elu #DEFINE_ALIAS
# from .functional.activation import erf #DEFINE_ALIAS
# from .functional.activation import gelu #DEFINE_ALIAS
# from .functional.activation import hard_shrink #DEFINE_ALIAS
# from .functional.activation import hard_sigmoid #DEFINE_ALIAS
# from .functional.activation import hard_swish #DEFINE_ALIAS
# from .functional.activation import hsigmoid #DEFINE_ALIAS
# from .functional.activation import leaky_relu #DEFINE_ALIAS
# from .functional.activation import logsigmoid #DEFINE_ALIAS
# from .functional.activation import maxout #DEFINE_ALIAS
# from .functional.activation import prelu #DEFINE_ALIAS
# from .functional.activation import relu #DEFINE_ALIAS
# from .functional.activation import relu6 #DEFINE_ALIAS
# from .functional.activation import selu #DEFINE_ALIAS
# from .functional.activation import sigmoid #DEFINE_ALIAS
# from .functional.activation import soft_relu #DEFINE_ALIAS
# from .functional.activation import softmax #DEFINE_ALIAS
# from .functional.activation import softplus #DEFINE_ALIAS
# from .functional.activation import softshrink #DEFINE_ALIAS
# from .functional.activation import softsign #DEFINE_ALIAS
# from .functional.activation import swish #DEFINE_ALIAS
# from .functional.activation import tanh_shrink #DEFINE_ALIAS
# from .functional.activation import thresholded_relu #DEFINE_ALIAS
# from .functional.activation import log_softmax #DEFINE_ALIAS
# from .functional.extension import add_position_encoding #DEFINE_ALIAS
# from .functional.extension import autoincreased_step_counter #DEFINE_ALIAS
# from .functional.extension import continuous_value_model #DEFINE_ALIAS
# from .functional.extension import filter_by_instag #DEFINE_ALIAS
# from .functional.extension import linear_chain_crf #DEFINE_ALIAS
# from .functional.extension import merge_selected_rows #DEFINE_ALIAS
# from .functional.extension import multiclass_nms #DEFINE_ALIAS
# from .functional.extension import polygon_box_transform #DEFINE_ALIAS
# from .functional.extension import random_crop #DEFINE_ALIAS
# from .functional.extension import row_conv #DEFINE_ALIAS
# from .functional.extension import rpn_target_assign #DEFINE_ALIAS
# from .functional.extension import similarity_focus #DEFINE_ALIAS
# from .functional.extension import target_assign #DEFINE_ALIAS
# from .functional.extension import temporal_shift #DEFINE_ALIAS
# from .functional.extension import warpctc #DEFINE_ALIAS
# from .functional.extension import diag_embed #DEFINE_ALIAS
# from .functional.rnn import gru_unit #DEFINE_ALIAS
# from .functional.rnn import lstm #DEFINE_ALIAS
# from .functional.rnn import lstm_unit #DEFINE_ALIAS
# from .functional.lod import sequence_concat #DEFINE_ALIAS
# from .functional.lod import sequence_conv #DEFINE_ALIAS
# from .functional.lod import sequence_enumerate #DEFINE_ALIAS
# from .functional.lod import sequence_expand_as #DEFINE_ALIAS
# from .functional.lod import sequence_expand #DEFINE_ALIAS
# from .functional.lod import sequence_first_step #DEFINE_ALIAS
# from .functional.lod import sequence_last_step #DEFINE_ALIAS
# from .functional.lod import sequence_mask #DEFINE_ALIAS
# from .functional.lod import sequence_pad #DEFINE_ALIAS
# from .functional.lod import sequence_pool #DEFINE_ALIAS
# from .functional.lod import sequence_reshape #DEFINE_ALIAS
# from .functional.lod import sequence_reverse #DEFINE_ALIAS
# from .functional.lod import sequence_scatter #DEFINE_ALIAS
# from .functional.lod import sequence_slice #DEFINE_ALIAS
# from .functional.lod import sequence_softmax #DEFINE_ALIAS
# from .functional.lod import sequence_unpad #DEFINE_ALIAS
# from .functional.lod import array_length #DEFINE_ALIAS
# from .functional.lod import array_read #DEFINE_ALIAS
# from .functional.lod import array_write #DEFINE_ALIAS
# from .functional.lod import create_array #DEFINE_ALIAS
# from .functional.lod import hash #DEFINE_ALIAS
# from .functional.lod import im2sequence #DEFINE_ALIAS
# from .functional.lod import lod_append #DEFINE_ALIAS
# from .functional.lod import lod_reset #DEFINE_ALIAS
# from .functional.lod import reorder_lod_tensor_by_rank #DEFINE_ALIAS
# from .functional.lod import tensor_array_to_tensor #DEFINE_ALIAS
# from .functional.lod import dynamic_gru #DEFINE_ALIAS
# from .functional.lod import dynamic_lstm #DEFINE_ALIAS
# from .functional.lod import dynamic_lstmp #DEFINE_ALIAS
# from .functional.common import dropout #DEFINE_ALIAS
# from .functional.common import embedding #DEFINE_ALIAS
# from .functional.common import fc #DEFINE_ALIAS
# from .functional.common import label_smooth #DEFINE_ALIAS
# from .functional.common import one_hot #DEFINE_ALIAS
# from .functional.common import pad #DEFINE_ALIAS
# from .functional.common import pad_constant_like #DEFINE_ALIAS
# from .functional.common import pad2d #DEFINE_ALIAS
# from .functional.common import unfold #DEFINE_ALIAS
# from .functional.common import bilinear_tensor_product #DEFINE_ALIAS
# from .functional.common import assign #DEFINE_ALIAS
# from .functional.common import interpolate #DEFINE_ALIAS
# from .input import data #DEFINE_ALIAS
# from .input import Input #DEFINE_ALIAS
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: import all neural network related api under this directory,
# including layers, linear, conv, rnn etc.
# __all__ = [ ]
# TODO: define alias in functional directory
# from .conv import conv2d #DEFINE_ALIAS
# from .conv import conv2d_transpose #DEFINE_ALIAS
# from .conv import conv3d #DEFINE_ALIAS
# from .conv import conv3d_transpose #DEFINE_ALIAS
# from .loss import bpr_loss #DEFINE_ALIAS
# from .loss import center_loss #DEFINE_ALIAS
# from .loss import cross_entropy #DEFINE_ALIAS
# from .loss import dice_loss #DEFINE_ALIAS
# from .loss import edit_distance #DEFINE_ALIAS
# from .loss import huber_loss #DEFINE_ALIAS
# from .loss import iou_similarity #DEFINE_ALIAS
# from .loss import kldiv_loss #DEFINE_ALIAS
# from .loss import log_loss #DEFINE_ALIAS
# from .loss import margin_rank_loss #DEFINE_ALIAS
# from .loss import mse_loss #DEFINE_ALIAS
# from .loss import nce #DEFINE_ALIAS
# from .loss import npair_loss #DEFINE_ALIAS
# from .loss import rank_loss #DEFINE_ALIAS
# from .loss import sampled_softmax_with_cross_entropy #DEFINE_ALIAS
# from .loss import sigmoid_cross_entropy_with_logits #DEFINE_ALIAS
# from .loss import sigmoid_focal_loss #DEFINE_ALIAS
# from .loss import smooth_l1 #DEFINE_ALIAS
# from .loss import softmax_with_cross_entropy #DEFINE_ALIAS
# from .loss import square_error_cost #DEFINE_ALIAS
# from .loss import ssd_loss #DEFINE_ALIAS
# from .loss import teacher_student_sigmoid_loss #DEFINE_ALIAS
# from .learning_rate import cosine_decay #DEFINE_ALIAS
# from .learning_rate import exponential_decay #DEFINE_ALIAS
# from .learning_rate import inverse_time_decay #DEFINE_ALIAS
# from .learning_rate import natural_exp_decay #DEFINE_ALIAS
# from .learning_rate import noam_decay #DEFINE_ALIAS
# from .learning_rate import piecewise_decay #DEFINE_ALIAS
# from .learning_rate import polynomial_decay #DEFINE_ALIAS
# from .learning_rate import linear_lr_warmup #DEFINE_ALIAS
# from .transformer import #DEFINE_ALIAS
# from .pooling import pool2d #DEFINE_ALIAS
# from .pooling import pool3d #DEFINE_ALIAS
# from .pooling import adaptive_pool2d #DEFINE_ALIAS
# from .pooling import adaptive_pool3d #DEFINE_ALIAS
# from .norm import batch_norm #DEFINE_ALIAS
# from .norm import data_norm #DEFINE_ALIAS
# from .norm import group_norm #DEFINE_ALIAS
# from .norm import instance_norm #DEFINE_ALIAS
# from .norm import l2_normalize #DEFINE_ALIAS
# from .norm import layer_norm #DEFINE_ALIAS
# from .norm import lrn #DEFINE_ALIAS
# from .norm import spectral_norm #DEFINE_ALIAS
# from .vision import affine_channel #DEFINE_ALIAS
# from .vision import affine_grid #DEFINE_ALIAS
# from .vision import anchor_generator #DEFINE_ALIAS
# from .vision import bipartite_match #DEFINE_ALIAS
# from .vision import box_clip #DEFINE_ALIAS
# from .vision import box_coder #DEFINE_ALIAS
# from .vision import box_decoder_and_assign #DEFINE_ALIAS
# from .vision import collect_fpn_proposals #DEFINE_ALIAS
# from .vision import deformable_conv #DEFINE_ALIAS
# from .vision import deformable_roi_pooling #DEFINE_ALIAS
# from .vision import density_prior_box #DEFINE_ALIAS
# from .vision import detection_output #DEFINE_ALIAS
# from .vision import distribute_fpn_proposals #DEFINE_ALIAS
# from .vision import fsp_matrix #DEFINE_ALIAS
# from .vision import generate_mask_labels #DEFINE_ALIAS
# from .vision import generate_proposal_labels #DEFINE_ALIAS
# from .vision import generate_proposals #DEFINE_ALIAS
# from .vision import grid_sampler #DEFINE_ALIAS
# from .vision import image_resize #DEFINE_ALIAS
# from .vision import image_resize_short #DEFINE_ALIAS
# from .vision import multi_box_head #DEFINE_ALIAS
# from .vision import pixel_shuffle #DEFINE_ALIAS
# from .vision import prior_box #DEFINE_ALIAS
# from .vision import prroi_pool #DEFINE_ALIAS
# from .vision import psroi_pool #DEFINE_ALIAS
# from .vision import resize_bilinear #DEFINE_ALIAS
# from .vision import resize_nearest #DEFINE_ALIAS
# from .vision import resize_trilinear #DEFINE_ALIAS
# from .vision import retinanet_detection_output #DEFINE_ALIAS
# from .vision import retinanet_target_assign #DEFINE_ALIAS
# from .vision import roi_align #DEFINE_ALIAS
# from .vision import roi_perspective_transform #DEFINE_ALIAS
# from .vision import roi_pool #DEFINE_ALIAS
# from .vision import shuffle_channel #DEFINE_ALIAS
# from .vision import space_to_depth #DEFINE_ALIAS
# from .vision import yolo_box #DEFINE_ALIAS
# from .vision import yolov3_loss #DEFINE_ALIAS
# from .activation import brelu #DEFINE_ALIAS
# from .activation import elu #DEFINE_ALIAS
# from .activation import erf #DEFINE_ALIAS
# from .activation import gelu #DEFINE_ALIAS
# from .activation import hard_shrink #DEFINE_ALIAS
# from .activation import hard_sigmoid #DEFINE_ALIAS
# from .activation import hard_swish #DEFINE_ALIAS
# from .activation import hsigmoid #DEFINE_ALIAS
# from .activation import leaky_relu #DEFINE_ALIAS
# from .activation import logsigmoid #DEFINE_ALIAS
# from .activation import maxout #DEFINE_ALIAS
# from .activation import prelu #DEFINE_ALIAS
# from .activation import relu #DEFINE_ALIAS
# from .activation import relu6 #DEFINE_ALIAS
# from .activation import selu #DEFINE_ALIAS
# from .activation import sigmoid #DEFINE_ALIAS
# from .activation import soft_relu #DEFINE_ALIAS
# from .activation import softmax #DEFINE_ALIAS
# from .activation import softplus #DEFINE_ALIAS
# from .activation import softshrink #DEFINE_ALIAS
# from .activation import softsign #DEFINE_ALIAS
# from .activation import swish #DEFINE_ALIAS
# from .activation import tanh_shrink #DEFINE_ALIAS
# from .activation import thresholded_relu #DEFINE_ALIAS
# from .activation import log_softmax #DEFINE_ALIAS
# from .extension import add_position_encoding #DEFINE_ALIAS
# from .extension import autoincreased_step_counter #DEFINE_ALIAS
# from .extension import continuous_value_model #DEFINE_ALIAS
# from .extension import filter_by_instag #DEFINE_ALIAS
# from .extension import linear_chain_crf #DEFINE_ALIAS
# from .extension import merge_selected_rows #DEFINE_ALIAS
# from .extension import multiclass_nms #DEFINE_ALIAS
# from .extension import polygon_box_transform #DEFINE_ALIAS
# from .extension import random_crop #DEFINE_ALIAS
# from .extension import row_conv #DEFINE_ALIAS
# from .extension import rpn_target_assign #DEFINE_ALIAS
# from .extension import similarity_focus #DEFINE_ALIAS
# from .extension import target_assign #DEFINE_ALIAS
# from .extension import temporal_shift #DEFINE_ALIAS
# from .extension import warpctc #DEFINE_ALIAS
# from .extension import diag_embed #DEFINE_ALIAS
# from .rnn import gru_unit #DEFINE_ALIAS
# from .rnn import lstm #DEFINE_ALIAS
# from .rnn import lstm_unit #DEFINE_ALIAS
# from .lod import sequence_concat #DEFINE_ALIAS
# from .lod import sequence_conv #DEFINE_ALIAS
# from .lod import sequence_enumerate #DEFINE_ALIAS
# from .lod import sequence_expand_as #DEFINE_ALIAS
# from .lod import sequence_expand #DEFINE_ALIAS
# from .lod import sequence_first_step #DEFINE_ALIAS
# from .lod import sequence_last_step #DEFINE_ALIAS
# from .lod import sequence_mask #DEFINE_ALIAS
# from .lod import sequence_pad #DEFINE_ALIAS
# from .lod import sequence_pool #DEFINE_ALIAS
# from .lod import sequence_reshape #DEFINE_ALIAS
# from .lod import sequence_reverse #DEFINE_ALIAS
# from .lod import sequence_scatter #DEFINE_ALIAS
# from .lod import sequence_slice #DEFINE_ALIAS
# from .lod import sequence_softmax #DEFINE_ALIAS
# from .lod import sequence_unpad #DEFINE_ALIAS
# from .lod import array_length #DEFINE_ALIAS
# from .lod import array_read #DEFINE_ALIAS
# from .lod import array_write #DEFINE_ALIAS
# from .lod import create_array #DEFINE_ALIAS
# from .lod import hash #DEFINE_ALIAS
# from .lod import im2sequence #DEFINE_ALIAS
# from .lod import lod_append #DEFINE_ALIAS
# from .lod import lod_reset #DEFINE_ALIAS
# from .lod import reorder_lod_tensor_by_rank #DEFINE_ALIAS
# from .lod import tensor_array_to_tensor #DEFINE_ALIAS
# from .lod import dynamic_gru #DEFINE_ALIAS
# from .lod import dynamic_lstm #DEFINE_ALIAS
# from .lod import dynamic_lstmp #DEFINE_ALIAS
# from .common import dropout #DEFINE_ALIAS
# from .common import embedding #DEFINE_ALIAS
# from .common import fc #DEFINE_ALIAS
# from .common import label_smooth #DEFINE_ALIAS
# from .common import one_hot #DEFINE_ALIAS
# from .common import pad #DEFINE_ALIAS
# from .common import pad_constant_like #DEFINE_ALIAS
# from .common import pad2d #DEFINE_ALIAS
# from .common import unfold #DEFINE_ALIAS
# from .common import bilinear_tensor_product #DEFINE_ALIAS
# from .common import assign #DEFINE_ALIAS
# from .common import interpolate #DEFINE_ALIAS
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -12,6 +12,160 @@ ...@@ -12,6 +12,160 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# TODO: import all tensor api under this directory, #TODO: define alias in tensor and framework directory
# including tensor creation, manipulation, math, etc. # from .creation import create_ #DEFINE_ALIAS
# __all__ = [ ] # from .creation import create_lod_ #DEFINE_ALIAS
# from .creation import create_random_int_lod #DEFINE_ALIAS
# from .creation import crop_ #DEFINE_ALIAS
# from .creation import diag #DEFINE_ALIAS
# from .creation import eye #DEFINE_ALIAS
# from .creation import fill_constant #DEFINE_ALIAS
# from .creation import get__from_selected_rows #DEFINE_ALIAS
# from .creation import linspace #DEFINE_ALIAS
# from .creation import ones #DEFINE_ALIAS
# from .creation import ones_like #DEFINE_ALIAS
# from .creation import range #DEFINE_ALIAS
# from .creation import zeros #DEFINE_ALIAS
# from .creation import zeros_like #DEFINE_ALIAS
# from .creation import arrange #DEFINE_ALIAS
# from .creation import eye #DEFINE_ALIAS
# from .creation import full #DEFINE_ALIAS
# from .creation import linspace #DEFINE_ALIAS
# from .creation import full_like #DEFINE_ALIAS
# from .creation import triu #DEFINE_ALIAS
# from .creation import tril #DEFINE_ALIAS
# from .creation import meshgrid #DEFINE_ALIAS
# from .stat import mean #DEFINE_ALIAS
# from .stat import reduce_mean #DEFINE_ALIAS
# from .stat import std #DEFINE_ALIAS
# from .stat import var #DEFINE_ALIAS
# from .logic import equal #DEFINE_ALIAS
# from .logic import greater_equal #DEFINE_ALIAS
# from .logic import greater_than #DEFINE_ALIAS
# from .logic import is_empty #DEFINE_ALIAS
# from .logic import isfinite #DEFINE_ALIAS
# from .logic import less_equal #DEFINE_ALIAS
# from .logic import less_than #DEFINE_ALIAS
# from .logic import logical_and #DEFINE_ALIAS
# from .logic import logical_not #DEFINE_ALIAS
# from .logic import logical_or #DEFINE_ALIAS
# from .logic import logical_xor #DEFINE_ALIAS
# from .logic import not_equal #DEFINE_ALIAS
# from .logic import reduce_all #DEFINE_ALIAS
# from .logic import reduce_any #DEFINE_ALIAS
# from .logic import allclose #DEFINE_ALIAS
# from .logic import elementwise_equal #DEFINE_ALIAS
# from .logic import isnan #DEFINE_ALIAS
# from . import Tensor #DEFINE_ALIAS
# from . import LoDTensor #DEFINE_ALIAS
# from . import LoDTensorArray #DEFINE_ALIAS
# from .random import gaussin #DEFINE_ALIAS
# from .random import uniform #DEFINE_ALIAS
# from .random import shuffle #DEFINE_ALIAS
# from .random import randn #DEFINE_ALIAS
# from .random import randperm #DEFINE_ALIAS
# from .random import rand #DEFINE_ALIAS
# from .random import randint #DEFINE_ALIAS
# from .math import abs #DEFINE_ALIAS
# from .math import acos #DEFINE_ALIAS
# from .math import asin #DEFINE_ALIAS
# from .math import atan #DEFINE_ALIAS
# from .math import ceil #DEFINE_ALIAS
# from .math import cos #DEFINE_ALIAS
# from .math import cumsum #DEFINE_ALIAS
# from .math import elementwise_add #DEFINE_ALIAS
# from .math import elementwise_div #DEFINE_ALIAS
# from .math import elementwise_floordiv #DEFINE_ALIAS
# from .math import elementwise_max #DEFINE_ALIAS
# from .math import elementwise_min #DEFINE_ALIAS
# from .math import elementwise_mod #DEFINE_ALIAS
# from .math import elementwise_mul #DEFINE_ALIAS
# from .math import elementwise_pow #DEFINE_ALIAS
# from .math import elementwise_sub #DEFINE_ALIAS
# from .math import exp #DEFINE_ALIAS
# from .math import floor #DEFINE_ALIAS
# from .math import increment #DEFINE_ALIAS
# from .math import log #DEFINE_ALIAS
# from .math import mul #DEFINE_ALIAS
# from .math import multiplex #DEFINE_ALIAS
# from .math import pow #DEFINE_ALIAS
# from .math import reciprocal #DEFINE_ALIAS
# from .math import reduce_max #DEFINE_ALIAS
# from .math import reduce_min #DEFINE_ALIAS
# from .math import reduce_prod #DEFINE_ALIAS
# from .math import reduce_sum #DEFINE_ALIAS
# from .math import round #DEFINE_ALIAS
# from .math import rsqrt #DEFINE_ALIAS
# from .math import scale #DEFINE_ALIAS
# from .math import sign #DEFINE_ALIAS
# from .math import sin #DEFINE_ALIAS
# from .math import sqrt #DEFINE_ALIAS
# from .math import square #DEFINE_ALIAS
# from .math import stanh #DEFINE_ALIAS
# from .math import sum #DEFINE_ALIAS
# from .math import sums #DEFINE_ALIAS
# from .math import tanh #DEFINE_ALIAS
# from .math import elementwise_sum #DEFINE_ALIAS
# from .math import max #DEFINE_ALIAS
# from .math import min #DEFINE_ALIAS
# from .math import mm #DEFINE_ALIAS
# from .math import div #DEFINE_ALIAS
# from .math import add #DEFINE_ALIAS
# from .math import atan #DEFINE_ALIAS
# from .math import logsumexp #DEFINE_ALIAS
# from .math import inverse #DEFINE_ALIAS
# from .math import log1p #DEFINE_ALIAS
# from .math import erf #DEFINE_ALIAS
# from .math import addcmul #DEFINE_ALIAS
# from .math import addmm #DEFINE_ALIAS
# from .attribute import rank #DEFINE_ALIAS
# from .attribute import shape #DEFINE_ALIAS
# from .io import save #DEFINE_ALIAS
# from .io import load #DEFINE_ALIAS
# from .linalg import matmul #DEFINE_ALIAS
# from .linalg import dot #DEFINE_ALIAS
# from .linalg import einsum #DEFINE_ALIAS
# from .linalg import morm #DEFINE_ALIAS
# from .linalg import transpose #DEFINE_ALIAS
# from .linalg import dist #DEFINE_ALIAS
# from .linalg import t #DEFINE_ALIAS
# from .linalg import cross #DEFINE_ALIAS
# from .linalg import cholesky #DEFINE_ALIAS
# from .linalg import dot #DEFINE_ALIAS
# from .manipulation import cast #DEFINE_ALIAS
# from .manipulation import concat #DEFINE_ALIAS
# from .manipulation import expand #DEFINE_ALIAS
# from .manipulation import expand_as #DEFINE_ALIAS
# from .manipulation import flatten #DEFINE_ALIAS
# from .manipulation import gather #DEFINE_ALIAS
# from .manipulation import gather_nd #DEFINE_ALIAS
# from .manipulation import reshape #DEFINE_ALIAS
# from .manipulation import reverse #DEFINE_ALIAS
# from .manipulation import scatter #DEFINE_ALIAS
# from .manipulation import scatter_nd_add #DEFINE_ALIAS
# from .manipulation import scatter_nd #DEFINE_ALIAS
# from .manipulation import shard_index #DEFINE_ALIAS
# from .manipulation import slice #DEFINE_ALIAS
# from .manipulation import split #DEFINE_ALIAS
# from .manipulation import squeeze #DEFINE_ALIAS
# from .manipulation import stack #DEFINE_ALIAS
# from .manipulation import strided_slice #DEFINE_ALIAS
# from .manipulation import transpose #DEFINE_ALIAS
# from .manipulation import unique #DEFINE_ALIAS
# from .manipulation import unique_with_counts #DEFINE_ALIAS
# from .manipulation import unsqueeze #DEFINE_ALIAS
# from .manipulation import unstack #DEFINE_ALIAS
# from .manipulation import flip #DEFINE_ALIAS
# from .manipulation import unbind #DEFINE_ALIAS
# from .manipulation import roll #DEFINE_ALIAS
# from .search import argmax #DEFINE_ALIAS
# from .search import argmin #DEFINE_ALIAS
# from .search import argsort #DEFINE_ALIAS
# from .search import has_inf #DEFINE_ALIAS
# from .search import has_nan #DEFINE_ALIAS
# from .search import masked_select #DEFINE_ALIAS
# from .search import topk #DEFINE_ALIAS
# from .search import where #DEFINE_ALIAS
# from .search import index_select #DEFINE_ALIAS
# from .search import nonzero #DEFINE_ALIAS
# from .search import sort #DEFINE_ALIAS
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册