| @@ -12,8 +12,8 @@ | |||||
| # 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. | ||||
| # ============================================================================ | # ============================================================================ | ||||
| from mindspore.ops.op_info_register import op_info_register | |||||
| """batch_matmul_impl""" | """batch_matmul_impl""" | ||||
| from mindspore.ops.op_info_register import op_info_register | |||||
| @op_info_register("""{ | @op_info_register("""{ | ||||
| "op_name": "CusBatchMatMul", | "op_name": "CusBatchMatMul", | ||||
| @@ -12,8 +12,8 @@ | |||||
| # 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. | ||||
| # ============================================================================ | # ============================================================================ | ||||
| from mindspore.ops.op_info_register import op_info_register | |||||
| """CusCholeskyTrsm""" | """CusCholeskyTrsm""" | ||||
| from mindspore.ops.op_info_register import op_info_register | |||||
| @op_info_register("""{ | @op_info_register("""{ | ||||
| "op_name": "CusCholeskyTrsm", | "op_name": "CusCholeskyTrsm", | ||||
| @@ -109,4 +109,5 @@ NoneType = type(None) | |||||
| }""") | }""") | ||||
| def CusMatMulCubeFraczRightMul(input_x1, input_x2, input_x3, bias=None, output_y={}, trans_a=False, trans_b=False, | def CusMatMulCubeFraczRightMul(input_x1, input_x2, input_x3, bias=None, output_y={}, trans_a=False, trans_b=False, | ||||
| kernel_name="matmulcube"): | kernel_name="matmulcube"): | ||||
| """CusMatMulCubeFraczRightMul""" | |||||
| return | return | ||||
| @@ -530,7 +530,7 @@ class Model: | |||||
| valid_dataset (Dataset): Dataset to evaluate the model. | valid_dataset (Dataset): Dataset to evaluate the model. | ||||
| list_callback (ListCallback): Executor of callback list. Default: None. | list_callback (ListCallback): Executor of callback list. Default: None. | ||||
| cb_params (_InternalCallbackParam): Callback parameters. Default: None. | cb_params (_InternalCallbackParam): Callback parameters. Default: None. | ||||
| Returns: | Returns: | ||||
| Dict, returns the loss value & metrics values for the model in test mode. | Dict, returns the loss value & metrics values for the model in test mode. | ||||
| """ | """ | ||||
| @@ -126,7 +126,7 @@ def _bn_last(channel): | |||||
| def _fc(in_channel, out_channel, damping, loss_scale, frequency): | def _fc(in_channel, out_channel, damping, loss_scale, frequency): | ||||
| weight_shape = (out_channel, in_channel) | weight_shape = (out_channel, in_channel) | ||||
| weight = Tensor(kaiming_uniform(weight_shape, a=math.sqrt(5)) | weight = Tensor(kaiming_uniform(weight_shape, a=math.sqrt(5)) | ||||
| return Dense_Thor(in_channel, out_channel, has_bias=False, weight_init=weight, | |||||
| return Dense_Thor(in_channel, out_channel, has_bias=False, weight_init=weight, \ | |||||
| bias_init=0, damping=damping, loss_scale=loss_scale, frequency=frequency) | bias_init=0, damping=damping, loss_scale=loss_scale, frequency=frequency) | ||||
| @@ -196,7 +196,7 @@ class Conv2d_Thor(_Conv): | |||||
| self.channels_slice_flag = True | self.channels_slice_flag = True | ||||
| self.padA_flag = False | self.padA_flag = False | ||||
| if (self.matrix_A_dim // self.diag_block_dim) * self.diag_block_dim != self.matrix_A_dim | |||||
| if (self.matrix_A_dim // self.diag_block_dim) * self.diag_block_dim != self.matrix_A_dim \ | |||||
| and self.matrix_A_dim > self.diag_block_dim: | and self.matrix_A_dim > self.diag_block_dim: | ||||
| self.padA_flag = True | self.padA_flag = True | ||||
| pad_dim = self.diag_block_dim - self.matrix_A_dim % self.diag_block_dim | pad_dim = self.diag_block_dim - self.matrix_A_dim % self.diag_block_dim | ||||
| @@ -82,9 +82,9 @@ def get_second_order_damping(global_step, damping_init, decay_rate, total_epochs | |||||
| current_step = global_step | current_step = global_step | ||||
| damping_each_step = np.array(damping_each_step).astype(np.float32) | damping_each_step = np.array(damping_each_step).astype(np.float32) | ||||
| damping = damping_each_step[current_step:] | |||||
| print("damping_is=========", damping) | |||||
| return damping | |||||
| damping_now = damping_each_step[current_step:] | |||||
| print("damping_is=========", damping_now) | |||||
| return damping_now | |||||
| if __name__ == '__main__': | if __name__ == '__main__': | ||||