parameters: (self, path, training=True)
docstring: This function saves parameters, optimizer information or model and 
          paramters only for inference to path. It depends on the parameter
          `training`.
  
          If `training` is set to True, the parameters saved contain all 
          the trainable Variable, will save to a file with suffix ".pdparams".
          The optimizer information contains all the variable used by optimizer.
          For Adam optimizer, contains beta1, beta2, momentum etc. All the
          information will save to a file with suffix ".pdopt". (If the optimizer
          have no variable need to save (like SGD), the fill will not generated).
          This function will silently overwrite existing file at the target location.
  
          If `training` is set to False, only inference model will be saved.
  
          Args:
              path (str): The file prefix to save model. The format
                  is 'dirname/file_prefix' or 'file_prefix'. if empty str.
                  A exception will be raised.
              training (bool, optional): Whether to save for training. If not, save
                  for inference only. Default: True.
  
          Returns:
              None
  
          Examples:
  
              .. code-block:: python
  
                  import paddle
                  import paddle.nn as nn
                  import paddle.vision.transforms as T
                  from paddle.static import InputSpec
  
                  class Mnist(nn.Layer):
                      def __init__(self):
                          super(Mnist, self).__init__()
                          self.net = nn.Sequential(
                              nn.Flatten(1),
                              nn.Linear(784, 200),
                              nn.Tanh(),
                              nn.Linear(200, 10),
                              nn.Softmax())
  
                      def forward(self, x):
                          return self.net(x)
  
                  dynamic = True  # False
                  # if use static graph, do not set
                  if not dynamic:
                      paddle.enable_static()
  
                  input = InputSpec([None, 784], 'float32', 'x')
                  label = InputSpec([None, 1], 'int64', 'label')
                  model = paddle.Model(Mnist(), input, label)
                  optim = paddle.optimizer.SGD(learning_rate=1e-3,
                      parameters=model.parameters())
                  model.prepare(optim, paddle.nn.CrossEntropyLoss())
                  
                  transform = T.Compose([
                      T.Transpose(),
                      T.Normalize([127.5], [127.5])
                  ])
                  data = paddle.vision.datasets.MNIST(mode='train', transform=transform)
                  
                  model.fit(data, epochs=1, batch_size=32, verbose=0)
                  model.save('checkpoint/test')  # save for training
                  model.save('inference_model', False)  # save for inference
docstring_summary: This function saves parameters, optimizer information or model and 
          paramters only for inference to path. It depends on the parameter
          `training`.
docstring_tokens: This function saves parameters optimizer information or model and paramters only for inference to path . It depends on the parameter training .
function: def save(self, path, training=True):
          """  
          This function saves parameters, optimizer information or model and 
          paramters only for inference to path. It depends on the parameter
          `training`.
  
          If `training` is set to True, the parameters saved contain all 
          the trainable Variable, will save to a file with suffix ".pdparams".
          The optimizer information contains all the variable used by optimizer.
          For Adam optimizer, contains beta1, beta2, momentum etc. All the
          information will save to a file with suffix ".pdopt". (If the optimizer
          have no variable need to save (like SGD), the fill will not generated).
          This function will silently overwrite existing file at the target location.
  
          If `training` is set to False, only inference model will be saved.
  
          Args:
              path (str): The file prefix to save model. The format
                  is 'dirname/file_prefix' or 'file_prefix'. if empty str.
                  A exception will be raised.
              training (bool, optional): Whether to save for training. If not, save
                  for inference only. Default: True.
  
          Returns:
              None
  
          Examples:
  
              .. code-block:: python
  
                  import paddle
                  import paddle.nn as nn
                  import paddle.vision.transforms as T
                  from paddle.static import InputSpec
  
                  class Mnist(nn.Layer):
                      def __init__(self):
                          super(Mnist, self).__init__()
                          self.net = nn.Sequential(
                              nn.Flatten(1),
                              nn.Linear(784, 200),
                              nn.Tanh(),
                              nn.Linear(200, 10),
                              nn.Softmax())
  
                      def forward(self, x):
                          return self.net(x)
  
                  dynamic = True  # False
                  # if use static graph, do not set
                  if not dynamic:
                      paddle.enable_static()
  
                  input = InputSpec([None, 784], 'float32', 'x')
                  label = InputSpec([None, 1], 'int64', 'label')
                  model = paddle.Model(Mnist(), input, label)
                  optim = paddle.optimizer.SGD(learning_rate=1e-3,
                      parameters=model.parameters())
                  model.prepare(optim, paddle.nn.CrossEntropyLoss())
                  
                  transform = T.Compose([
                      T.Transpose(),
                      T.Normalize([127.5], [127.5])
                  ])
                  data = paddle.vision.datasets.MNIST(mode='train', transform=transform)
                  
                  model.fit(data, epochs=1, batch_size=32, verbose=0)
                  model.save('checkpoint/test')  # save for training
                  model.save('inference_model', False)  # save for inference
          """
  
          if ParallelEnv().local_rank == 0:
              if not training:
                  self._save_inference_model(path)
              else:
                  self._adapter.save(path)
function_tokens: def save ( self , path , training = True ) : if ParallelEnv ( ) . local_rank == 0 : if not training : self . _save_inference_model ( path ) else : self . _adapter . save ( path )