Browse Source

for pylint 3rd

tags/v0.3.0-alpha
z00478463 5 years ago
parent
commit
80b738b0da
7 changed files with 9 additions and 8 deletions
  1. +1
    -1
      example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py
  2. +1
    -1
      example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py
  3. +1
    -0
      example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py
  4. +1
    -1
      example/resnet50_imagenet2012_THOR/model/model_thor.py
  5. +1
    -1
      example/resnet50_imagenet2012_THOR/model/resnet.py
  6. +1
    -1
      example/resnet50_imagenet2012_THOR/model/thor_layer.py
  7. +3
    -3
      example/resnet50_imagenet2012_THOR/train.py

+ 1
- 1
example/resnet50_imagenet2012_THOR/cus_ops/batch_matmul_impl.py View File

@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
from mindspore.ops.op_info_register import op_info_register
"""batch_matmul_impl"""
from mindspore.ops.op_info_register import op_info_register

@op_info_register("""{
"op_name": "CusBatchMatMul",


+ 1
- 1
example/resnet50_imagenet2012_THOR/cus_ops/cholesky_trsm.py View File

@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
from mindspore.ops.op_info_register import op_info_register
"""CusCholeskyTrsm"""
from mindspore.ops.op_info_register import op_info_register

@op_info_register("""{
"op_name": "CusCholeskyTrsm",


+ 1
- 0
example/resnet50_imagenet2012_THOR/cus_ops/matmul_cube_fracz_right_mul_impl.py View File

@@ -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,
kernel_name="matmulcube"):
"""CusMatMulCubeFraczRightMul"""
return

+ 1
- 1
example/resnet50_imagenet2012_THOR/model/model_thor.py View File

@@ -530,7 +530,7 @@ class Model:
valid_dataset (Dataset): Dataset to evaluate the model.
list_callback (ListCallback): Executor of callback list. Default: None.
cb_params (_InternalCallbackParam): Callback parameters. Default: None.
Returns:
Dict, returns the loss value & metrics values for the model in test mode.
"""


+ 1
- 1
example/resnet50_imagenet2012_THOR/model/resnet.py View File

@@ -126,7 +126,7 @@ def _bn_last(channel):
def _fc(in_channel, out_channel, damping, loss_scale, frequency):
weight_shape = (out_channel, in_channel)
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)




+ 1
- 1
example/resnet50_imagenet2012_THOR/model/thor_layer.py View File

@@ -196,7 +196,7 @@ class Conv2d_Thor(_Conv):
self.channels_slice_flag = True

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:
self.padA_flag = True
pad_dim = self.diag_block_dim - self.matrix_A_dim % self.diag_block_dim


+ 3
- 3
example/resnet50_imagenet2012_THOR/train.py View File

@@ -82,9 +82,9 @@ def get_second_order_damping(global_step, damping_init, decay_rate, total_epochs

current_step = global_step
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__':


Loading…
Cancel
Save