/third_party/mindspore/mindspore/lite/examples/export_models/models/ |
D | NetworkInNetwork.py | 18 import mindspore.nn as nn namespace 24 class NiN(nn.Cell): 29 self.block0 = nn.SequentialCell( 31 … nn.Conv2d(in_channels=num_channel, out_channels=192, kernel_size=5, stride=1, has_bias=False), 32 nn.ReLU(), 33 nn.Conv2d(in_channels=192, out_channels=160, kernel_size=1, stride=1, has_bias=True), 34 nn.ReLU(), 35 nn.Conv2d(in_channels=160, out_channels=96, kernel_size=1, stride=1, has_bias=True), 36 nn.ReLU(), 37 nn.MaxPool2d(kernel_size=3, stride=2, pad_mode='same'), [all …]
|
D | effnet.py | 18 import mindspore.nn as nn namespace 45 class Swish(nn.Cell): 48 self.sigmoid = nn.Sigmoid() 56 class AdaptiveAvgPool(nn.Cell): 66 class SELayer(nn.Cell): 73 …self.conv_reduce = nn.Conv2d(in_channels=channel, out_channels=reduced_chs, kernel_size=1, has_bia… 76 …self.conv_expand = nn.Conv2d(in_channels=reduced_chs, out_channels=channel, kernel_size=1, has_bia… 77 self.act2 = nn.Sigmoid() 88 class DepthwiseSeparableConv(nn.Cell): 98 …self.conv_dw = nn.Conv2d(in_channels=in_chs, out_channels=in_chs, kernel_size=dw_kernel_size, stri… [all …]
|
/third_party/mindspore/mindspore/train/train_thor/ |
D | convert_utils.py | 18 import mindspore.nn as nn namespace 28 self._convert_method_map = {nn.Dense: ConvertNetUtils._convert_dense, 29 nn.Embedding: ConvertNetUtils._convert_embedding, 30 nn.Conv2d: ConvertNetUtils._convert_conv2d, 31 nn.EmbeddingLookup: ConvertNetUtils._convert_embeddinglookup} 47 new_subcell = nn.DenseThor(in_channels=subcell.in_channels, 57 new_subcell = nn.DenseThor(in_channels=subcell.in_channels, 74 new_subcell = nn.EmbeddingThor(vocab_size=subcell.vocab_size, 86 new_subcell = nn.EmbeddingLookupThor(vocab_size=subcell.vocab_size, 108 new_subcell = nn.Conv2dThor(in_channel, out_channel, [all …]
|
/third_party/skia/third_party/externals/freetype/src/tools/ |
D | apinames.c | 69 int nn, len; in names_add() local 80 for ( nn = 0; nn < len; nn++ ) in names_add() 81 h = h * 33 + name[nn]; in names_add() 84 for ( nn = 0; nn < num_names; nn++ ) in names_add() 86 nm = the_names + nn; in names_add() 139 int nn; in names_dump() local 151 for ( nn = 0; nn < num_names; nn++ ) in names_dump() 152 fprintf( out, " %s\n", the_names[nn].name ); in names_dump() 163 for ( nn = 0; nn < num_names; nn++ ) in names_dump() 164 fprintf( out, " _%s\n", the_names[nn].name ); in names_dump() [all …]
|
/third_party/freetype/src/tools/ |
D | apinames.c | 68 int nn, len; in names_add() local 79 for ( nn = 0; nn < len; nn++ ) in names_add() 80 h = h * 33 + name[nn]; in names_add() 83 for ( nn = 0; nn < num_names; nn++ ) in names_add() 85 nm = the_names + nn; in names_add() 138 int nn; in names_dump() local 150 for ( nn = 0; nn < num_names; nn++ ) in names_dump() 151 fprintf( out, " %s\n", the_names[nn].name ); in names_dump() 162 for ( nn = 0; nn < num_names; nn++ ) in names_dump() 163 fprintf( out, " _%s\n", the_names[nn].name ); in names_dump() [all …]
|
/third_party/flutter/skia/third_party/externals/freetype/src/tools/ |
D | apinames.c | 68 int nn, len; in names_add() local 79 for ( nn = 0; nn < len; nn++ ) in names_add() 80 h = h * 33 + name[nn]; in names_add() 83 for ( nn = 0; nn < num_names; nn++ ) in names_add() 85 nm = the_names + nn; in names_add() 138 int nn; in names_dump() local 150 for ( nn = 0; nn < num_names; nn++ ) in names_dump() 151 fprintf( out, " %s\n", the_names[nn].name ); in names_dump() 162 for ( nn = 0; nn < num_names; nn++ ) in names_dump() 163 fprintf( out, " _%s\n", the_names[nn].name ); in names_dump() [all …]
|
/third_party/mindspore/tests/ut/python/nn/ |
D | test_container.py | 20 import mindspore.nn as nn namespace 27 conv2 = nn.Conv2d(3, 64, (3, 3), stride=2, padding=0) 32 avg_pool = nn.AvgPool2d(kernel_size, stride) 39 m = nn.SequentialCell() 43 m = nn.SequentialCell([conv2]) 47 m = nn.SequentialCell([conv2, avg_pool]) 51 m = nn.SequentialCell(OrderedDict( 56 m = nn.SequentialCell(OrderedDict( 61 m = nn.SequentialCell(OrderedDict( 67 m = nn.SequentialCell(OrderedDict( [all …]
|
D | test_triu.py | 20 import mindspore.nn as nn namespace 28 class Net(nn.Cell): 34 triu = nn.Triu() 43 class Net(nn.Cell): 49 triu = nn.Triu() 58 class Net(nn.Cell): 64 triu = nn.Triu() 73 class Net(nn.Cell): 78 triu = nn.Triu() 86 class Net(nn.Cell): [all …]
|
D | test_tril.py | 20 import mindspore.nn as nn namespace 28 class Net(nn.Cell): 34 tril = nn.Tril() 43 class Net(nn.Cell): 49 tril = nn.Tril() 58 class Net(nn.Cell): 64 tril = nn.Tril() 73 class Net(nn.Cell): 78 tril = nn.Tril() 86 class Net(nn.Cell): [all …]
|
D | test_resizebilinear.py | 18 import mindspore.nn as nn namespace 27 class Net(nn.Cell): 33 interpolate = nn.ResizeBilinear() 41 class Net(nn.Cell): 47 interpolate = nn.ResizeBilinear() 55 class Net(nn.Cell): 60 interpolate = nn.ResizeBilinear() 68 class Net(nn.Cell): 73 interpolate = nn.ResizeBilinear() 81 class Net(nn.Cell): [all …]
|
D | test_dense.py | 20 import mindspore.nn as nn namespace 29 nn.Dense(3, 2, None, None) 34 dense = nn.Dense(1, 1, activation='relu') 35 assert isinstance(dense.activation, nn.ReLU) 43 dense = nn.Dense(1, 1, activation=nn.ReLU()) 44 assert isinstance(dense.activation, nn.ReLU) 52 dense = nn.Dense(1, 1, activation=P.ReLU()) 62 nn.Dense(3, 2, dim_error) 66 nn.Dense(2, 2, shape_error) 68 nn.Dense(3, 3, shape_error) [all …]
|
D | test_loss.py | 19 from mindspore import nn 25 loss = nn.L1Loss() 32 loss = nn.MSELoss() 41 loss = nn.SoftmaxCrossEntropyWithLogits() 50 loss = nn.SoftmaxCrossEntropyWithLogits(reduction="mean") 59 loss = nn.BCELoss() 68 loss = nn.BCELoss(reduction='mean') 78 loss = nn.BCELoss(weight=weight) 87 loss = nn.CosineEmbeddingLoss() 98 focalloss = nn.FocalLoss() [all …]
|
/third_party/mindspore/tests/ut/python/pynative_mode/nn/ |
D | test_container.py | 20 import mindspore.nn as nn namespace 27 conv2 = nn.Conv2d(3, 64, (3, 3), stride=2, padding=0) 32 avg_pool = nn.AvgPool2d(kernel_size, stride) 39 m = nn.SequentialCell() 43 m = nn.SequentialCell([conv2]) 47 m = nn.SequentialCell([conv2, avg_pool]) 51 m = nn.SequentialCell(OrderedDict( 56 m = nn.SequentialCell(OrderedDict( 61 m = nn.SequentialCell(OrderedDict( 67 m = nn.SequentialCell(OrderedDict( [all …]
|
D | test_dense.py | 19 import mindspore.nn as nn namespace 28 dense = nn.Dense(3, 2, weight) 39 dense = nn.Dense(3, 2, bias_init=bias) 50 dense = nn.Dense(3, 2, weight, bias) 60 dense = nn.Dense(3, 2, weight, has_bias=False) 70 nn.Dense(3, 2, None, None) 74 dense = nn.Dense(1, 1, activation='relu') 75 assert isinstance(dense.activation, nn.ReLU) 86 nn.Dense(3, 2, dim_error) 90 nn.Dense(2, 2, shape_error) [all …]
|
/third_party/mindspore/mindspore/lite/examples/transfer_learning/model/ |
D | effnet.py | 3 import mindspore.nn as nn namespace 37 class Swish(nn.Cell): 40 self.sigmoid = nn.Sigmoid() 48 class AdaptiveAvgPool(nn.Cell): 58 class SELayer(nn.Cell): 67 self.conv_reduce = nn.Conv2d( 70 self.conv_expand = nn.Conv2d( 72 self.act2 = nn.Sigmoid() 83 class DepthwiseSeparableConv(nn.Cell): 96 … self.conv_dw = nn.Conv2d(in_channels=in_chs, out_channels=in_chs, kernel_size=dw_kernel_size, [all …]
|
/third_party/mindspore/tests/ut/python/ops/ |
D | test_nn_ops.py | 21 import mindspore.nn as nn namespace 42 return nn.Conv2d(in_channels, out_channels, 48 return nn.Conv2d(in_channels, out_channels, 56 class ResidualBlock(nn.Cell): 71 self.bn1 = nn.BatchNorm2d(out_chls) 74 self.bn2 = nn.BatchNorm2d(out_chls) 77 self.bn3 = nn.BatchNorm2d(out_channels) 79 self.relu = nn.ReLU() 84 self.bn_down_sample = nn.BatchNorm2d(out_channels) 159 class VirtualNetWithLoss(nn.Cell): [all …]
|
/third_party/mindspore/tests/ut/python/transform/ |
D | test_transform.py | 24 import mindspore.nn as nn namespace 35 return nn.Conv2d(in_channels, out_channels, 43 return nn.Conv2d(in_channels, out_channels, 48 class ResidualBlock(nn.Cell): 63 self.bn1 = nn.BatchNorm2d(out_chls) 66 self.bn2 = nn.BatchNorm2d(out_chls) 69 self.bn3 = nn.BatchNorm2d(out_channels) 71 self.relu = nn.ReLU() 77 self.bn_down_sample = nn.BatchNorm2d(out_channels) 104 class ResNet(nn.Cell): [all …]
|
/third_party/mindspore/tests/st/networks/models/deeplabv3/src/backbone/ |
D | resnet_deeplab.py | 16 import mindspore.nn as nn namespace 32 return nn.SequentialCell( 33 [nn.Conv2d(in_channel, 40 nn.BatchNorm2d(out_channel, use_batch_statistics=use_batch_statistics), 41 nn.ReLU()] 54 return nn.SequentialCell( 62 nn.BatchNorm2d(channel_multiplier * in_channel, use_batch_statistics=use_batch_statistics), 63 nn.ReLU()] 80 return nn.SequentialCell( 90 nn.BatchNorm2d(channel_multiplier * in_channel, use_batch_statistics=use_batch_statistics), [all …]
|
/third_party/mindspore/tests/ut/python/model/ |
D | res18_example.py | 20 import mindspore.nn as nn # pylint: disable=C0414 namespace 29 return nn.Conv2d(in_channels, out_channels, 35 return nn.Conv2d(in_channels, out_channels, 39 class ResidualBlock(nn.Cell): 54 self.bn1 = nn.BatchNorm2d(out_chls) 57 self.bn2 = nn.BatchNorm2d(out_chls) 60 self.bn3 = nn.BatchNorm2d(out_channels) 62 self.relu = nn.ReLU() 67 self.bn_down_sample = nn.BatchNorm2d(out_channels) 98 class ResNet18(nn.Cell): [all …]
|
/third_party/mindspore/tests/st/probability/dpn/ |
D | test_gpu_vae_gan.py | 22 import mindspore.nn as nn namespace 25 from mindspore.nn.probability.dpn import VAE 26 from mindspore.nn.probability.infer import ELBO, SVI 33 class Encoder(nn.Cell): 36 self.fc1 = nn.Dense(1024, 400) 37 self.relu = nn.ReLU() 38 self.flatten = nn.Flatten() 47 class Decoder(nn.Cell): 50 self.fc1 = nn.Dense(400, 1024) 51 self.relu = nn.ReLU() [all …]
|
/third_party/mindspore/tests/st/networks/ |
D | test_gpu_alexnet.py | 24 import mindspore.nn as nn namespace 26 from mindspore.nn import TrainOneStepCell, WithLossCell 27 from mindspore.nn.optim import Momentum 32 class AlexNet(nn.Cell): 36 self.conv1 = nn.Conv2d(3, 96, 11, stride=4, pad_mode="valid") 37 self.conv2 = nn.Conv2d(96, 256, 5, stride=1, pad_mode="same") 38 self.conv3 = nn.Conv2d(256, 384, 3, stride=1, pad_mode="same") 39 self.conv4 = nn.Conv2d(384, 384, 3, stride=1, pad_mode="same") 40 self.conv5 = nn.Conv2d(384, 256, 3, stride=1, pad_mode="same") 41 self.relu = nn.ReLU() [all …]
|
/third_party/mindspore/tests/ut/python/utils/ |
D | test_initializer_fuzz.py | 18 import mindspore.nn as nn namespace 22 class Net(nn.Cell): 37 self.conv = nn.Conv2d(a, b, c, pad_mode="valid") 38 self.bn = nn.BatchNorm2d(d) 39 self.relu = nn.ReLU() 40 self.flatten = nn.Flatten() 41 self.fc = nn.Dense(e * f * g, h) 52 class LeNet5(nn.Cell): 75 self.conv1 = nn.Conv2d(a1, a2, a3, pad_mode="valid") 76 self.conv2 = nn.Conv2d(a4, a5, a6, pad_mode="valid") [all …]
|
/third_party/mindspore/tests/ut/python/communication/ |
D | test_data_parallel_resnet.py | 21 import mindspore.nn as nn namespace 24 from mindspore.nn.optim import Momentum 31 return nn.Conv2d(in_channels, out_channels, 37 return nn.Conv2d(in_channels, out_channels, 41 class ResidualBlock(nn.Cell): 56 self.bn1 = nn.BatchNorm2d(out_chls) 59 self.bn2 = nn.BatchNorm2d(out_chls) 62 self.bn3 = nn.BatchNorm2d(out_channels) 64 self.relu = nn.ReLU() 69 self.bn_down_sample = nn.BatchNorm2d(out_channels) [all …]
|
/third_party/mindspore/tests/st/networks/models/ |
D | alexnet.py | 15 import mindspore.nn as nn namespace 19 class AlexNet(nn.Cell): 23 self.conv1 = nn.Conv2d(3, 96, 11, stride=4, pad_mode="valid") 24 self.conv2 = nn.Conv2d(96, 256, 5, stride=1, pad_mode="same") 25 self.conv3 = nn.Conv2d(256, 384, 3, stride=1, pad_mode="same") 26 self.conv4 = nn.Conv2d(384, 384, 3, stride=1, pad_mode="same") 27 self.conv5 = nn.Conv2d(384, 256, 3, stride=1, pad_mode="same") 29 self.max_pool2d = nn.MaxPool2d(kernel_size=3, stride=2) 30 self.flatten = nn.Flatten() 31 self.fc1 = nn.Dense(66256, 4096) [all …]
|
/third_party/mindspore/tests/perf_test/ |
D | resnet_example.py | 20 import mindspore.nn as nn namespace 26 return nn.Conv2d(in_channels, out_channels, 32 return nn.Conv2d(in_channels, out_channels, 36 class ResidualBlock(nn.Cell): 51 self.bn1 = nn.BatchNorm2d(out_chls) 54 self.bn2 = nn.BatchNorm2d(out_chls) 57 self.bn3 = nn.BatchNorm2d(out_channels) 59 self.relu = nn.ReLU() 64 self.bn_down_sample = nn.BatchNorm2d(out_channels) 95 class ResNet50(nn.Cell): [all …]
|