|
|
|
@ -116,7 +116,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_SoftLabel_1D(
|
|
|
|
|
self.shape = [13, 8]
|
|
|
|
|
self.axis = -1
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,7 +129,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_1D(
|
|
|
|
|
self.shape = [13, 8]
|
|
|
|
|
self.axis = -1
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,7 +145,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_SoftLabel_2D(
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
|
self.axis = -1
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -155,7 +155,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_SoftLabel_2D_Axis2(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = True
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 1
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
@ -168,7 +168,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_SoftLabel_2D_Axis3(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = True
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 2
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
@ -181,7 +181,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_SoftLabel_2D_Axis4(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = True
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 3
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
@ -206,7 +206,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_2D(
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
|
self.axis = -1
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -216,7 +216,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_2D_Axis2(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = False
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 1
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
@ -229,7 +229,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_2D_Axis3(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = False
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 2
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
@ -242,7 +242,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_2D_Axis4(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = False
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 3
|
|
|
|
|
self.ignore_index = -1
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
@ -267,7 +267,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_Ignore(
|
|
|
|
|
self.shape = [13, 8]
|
|
|
|
|
self.axis = -1
|
|
|
|
|
self.ignore_index = 2
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -280,7 +280,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_Ignore_Axis(
|
|
|
|
|
self.shape = [13, 8]
|
|
|
|
|
self.axis = 1
|
|
|
|
|
self.ignore_index = 2
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -293,7 +293,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_2D_Ignore(
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
|
self.axis = -1
|
|
|
|
|
self.ignore_index = 2
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.softmax_switch = False #default is true, means "with softmax"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -303,7 +303,7 @@ class TestSoftmaxWithCrossEntropyOp_NotWithSoftmax_HardLabel_2D_Ignore_Axis3(
|
|
|
|
|
self.op_type = "softmax_with_cross_entropy"
|
|
|
|
|
self.numeric_stable_mode = True
|
|
|
|
|
self.soft_label = False
|
|
|
|
|
self.dtype = np.float64
|
|
|
|
|
self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64
|
|
|
|
|
self.axis = 2
|
|
|
|
|
self.ignore_index = 2
|
|
|
|
|
self.shape = [3, 5, 7, 11]
|
|
|
|
|