@@ -855,7 +855,7 @@ def cos_sim(X, Y):
855
855
return out
856
856
857
857
858
- def dropout (x , dropout_prob , is_test = False , seed = None ):
858
+ def dropout (x , dropout_prob , is_test = False , seed = None , name = None ):
859
859
"""
860
860
Computes dropout.
861
861
@@ -873,6 +873,8 @@ def dropout(x, dropout_prob, is_test=False, seed=None):
873
873
parameter is set to None, a random seed is used.
874
874
NOTE: If an integer seed is given, always the same output
875
875
units will be dropped. DO NOT use a fixed seed in training.
876
+ name(str|None): A name for this layer(optional). If set None, the layer
877
+ will be named automatically.
876
878
877
879
Returns:
878
880
Variable: A tensor variable.
@@ -1117,7 +1119,7 @@ def sequence_softmax(input, param_attr=None, bias_attr=None, use_cudnn=True):
1117
1119
return softmax_out
1118
1120
1119
1121
1120
- def softmax (input , param_attr = None , bias_attr = None , use_cudnn = True ):
1122
+ def softmax (input , param_attr = None , bias_attr = None , use_cudnn = True , name = None ):
1121
1123
helper = LayerHelper ('softmax' , ** locals ())
1122
1124
dtype = helper .input_dtype ()
1123
1125
softmax_out = helper .create_tmp_variable (dtype )
@@ -2610,7 +2612,7 @@ def __check_input(x, y):
2610
2612
return out
2611
2613
2612
2614
2613
- def topk (input , k ):
2615
+ def topk (input , k , name = None ):
2614
2616
"""
2615
2617
This operator is used to find values and indices of the k largest entries
2616
2618
for the last dimension.
@@ -2626,6 +2628,8 @@ def topk(input, k):
2626
2628
input(Variable): The input variable which can be a vector or Tensor with
2627
2629
higher rank.
2628
2630
k(int): An integer value to specify the top k largest elements.
2631
+ name(str|None): A name for this layer(optional). If set None, the layer
2632
+ will be named automatically.
2629
2633
2630
2634
Returns:
2631
2635
values(Variable): The k largest elements along each last dimensional
0 commit comments