original_docstring: Rewrite WithLossCell as WithBNNLossCell to suit for BNN model.
docstring: Rewrite WithLossCell as WithBNNLossCell to suit for BNN model.
docstring_tokens: Rewrite WithLossCell as WithBNNLossCell to suit for BNN model .
code: def _generate_kl_loss_func(layer_count):
      """Rewrite WithLossCell as WithBNNLossCell to suit for BNN model."""
      path = os.path.dirname(mindspore.__file__) + '/nn/probability/transforms/bnn_loss/withLossCell.py'
      with open(path, 'r') as fp:
          srclines = fp.readlines()
      src = ''.join(srclines)
      if src.startswith((' ', '\t')):
          src = 'if 1:\n' + src
      expr_ast = ast.parse(src, mode='exec')
      transformer = _CodeTransformer(layer_count)
      modify = transformer.visit(expr_ast)
      modify = ast.fix_missing_locations(modify)
      func = astunparse.unparse(modify)
      return func
code_tokens: def _generate_kl_loss_func ( layer_count ) : path = os . path . dirname ( mindspore . __file__ ) + '/nn/probability/transforms/bnn_loss/withLossCell.py' with open ( path , 'r' ) as fp : srclines = fp . readlines ( ) src = '' . join ( srclines ) if src . startswith ( ( ' ' , '\t' ) ) : src = 'if 1:\n' + src expr_ast = ast . parse ( src , mode = 'exec' ) transformer = _CodeTransformer ( layer_count ) modify = transformer . visit ( expr_ast ) modify = ast . fix_missing_locations ( modify ) func = astunparse . unparse ( modify ) return func
short_docstring: Rewrite WithLossCell as WithBNNLossCell to suit for BNN model.
short_docstring_tokens: Rewrite WithLossCell as WithBNNLossCell to suit for BNN model .
comment: """Rewrite WithLossCell as WithBNNLossCell to suit for BNN model."""