<pre>
The operation to run when saving a model checkpoint.
</pre>

<code>optional string save_tensor_name = 2;</code>
501178
public com.google.protobuf.ByteString
      getSaveTensorNameBytes() {
    java.lang.Object ref = saveTensorName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      saveTensorName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
703852
public OpDef getOpDefByTensorflowName(String name) {
        if(!tensorflowOpDescriptors.containsKey(name)) {
            throw new ND4JIllegalStateException("No op found with name " + name);
        }

        return tensorflowOpDescriptors.get(name);
    }
826891
@Override
	public QualifiedName toQualifiedName(String qualifiedNameAsString) {
		if (criticalOperatorNames.contains(qualifiedNameAsString))
			return QualifiedName.create(qualifiedNameAsString);
		return super.toQualifiedName(qualifiedNameAsString);
	}
326428
public INDArray ndArrayFromTensor(TF_Tensor tensor) {
        int rank = TF_NumDims(tensor);

        int[] ndShape;
        if (rank == 0) {
            // scalar
            ndShape = new int[] { 1 };
        } else {
            ndShape = new int[rank];
            for (int i = 0; i < ndShape.length; i++) {
                ndShape[i] = (int) TF_Dim(tensor,i);
            }
        }

        int tfType = TF_TensorType(tensor);
        DataType nd4jType = typeFor(tfType);

        int length = ArrayUtil.prod(ndShape);
        INDArray array;
        if (nd4jType == DataType.UTF8) {
            String[] strings = new String[length];
            BytePointer data = new BytePointer(TF_TensorData(tensor)).capacity(TF_TensorByteSize(tensor));
            BytePointer str = new BytePointer((Pointer)null);
            SizeTPointer size = new SizeTPointer(1);
            TF_Status status = TF_NewStatus();
            for (int i = 0; i < length; i++) {
                long offset = data.position(8 * i).getLong();
                TF_StringDecode(data.position(8 * length + offset), data.capacity() - data.position(), str, size, status);
                if (TF_GetCode(status) != TF_OK) {
                    throw new IllegalStateException("ERROR: Unable to convert tensor " + TF_Message(status).getString());
                }
                strings[i] = str.position(0).capacity(size.get()).getString();
            }
            TF_DeleteStatus(status);
            array = Nd4j.create(strings);
        } else {
            Pointer pointer = TF_TensorData(tensor).capacity(length);
            Indexer indexer = indexerForType(nd4jType,pointer);
            DataBuffer d = Nd4j.createBuffer(indexer.pointer(),nd4jType,length,indexer);
            array = Nd4j.create(d,ndShape);
        }
        Nd4j.getAffinityManager().tagLocation(array, AffinityManager.Location.HOST);
        return array;
    }
1139606
public Tuple2<String, Val> nextKeyValue() throws IOException {
      if (currentValue.getKey() != NAME) {
         throw new IOException("Expecting NAME, but found " + jsonTokenToStructuredElement(null));
      }
      String name = currentValue.getValue().asString();
      consume();
      return Tuple2.of(name, nextValue());
   }
58367
def save(self, model_filename, optimizer_filename):
        
        serializers.save_hdf5(model_filename, self.model)
        serializers.save_hdf5(optimizer_filename, self.optimizer)
1003365
def save(filename)
      assert_exists
      image_reader = @object.getImageReader
      file = java.io.File.new(filename)
      buffered_image = image_reader.read(0);
      javax.imageio.ImageIO.write(buffered_image, image_reader.getFormatName(), file);
    end
1369620
public void saveToFilename(String file) {
    try {
      File tgtFile = new File(file);
      BufferedWriter out = new BufferedWriter(new FileWriter(tgtFile));
      // output index first, blank delimiter, outline feature index, then weights
      labelIndex.saveToWriter(out);
      featureIndex.saveToWriter(out);
      int numLabels = labelIndex.size();
      int numFeatures = featureIndex.size();
      for (int featIndex=0; featIndex<numFeatures; featIndex++) {
        for (int labelIndex=0;labelIndex<numLabels;labelIndex++) {
          out.write(String.valueOf(featIndex));
          out.write(TEXT_SERIALIZATION_DELIMITER);
          out.write(String.valueOf(labelIndex));
          out.write(TEXT_SERIALIZATION_DELIMITER);
          out.write(String.valueOf(weight(featIndex, labelIndex)));
          out.write("\n");
        }
      }

      // write out thresholds: first item after blank is the number of thresholds, after is the threshold array values.
      out.write("\n");
      out.write(String.valueOf(thresholds.length));
      out.write("\n");
      for (double val : thresholds) {
        out.write(String.valueOf(val));
        out.write("\n");
      }
      out.close();
    } catch (Exception e) {
      System.err.println("Error attempting to save classifier to file="+file);
      e.printStackTrace();
    }
  }
333334
public org.tensorflow.framework.RunOptions getOptions() {
    return options_ == null ? org.tensorflow.framework.RunOptions.getDefaultInstance() : options_;
  }
1000388
public File save(final String filename, final Serializer serializer) {
        File file = serializer.save(this, filename);
        if (log != null) //noinspection ConstantConditions
            log.info("Reflections successfully saved in " + file.getAbsolutePath() + " using " + serializer.getClass().getSimpleName());
        return file;
    }
847715
public org.tensorflow.framework.TensorDescription getTensorDescription() {
    return tensorDescription_ == null ? org.tensorflow.framework.TensorDescription.getDefaultInstance() : tensorDescription_;
  }
498307
def _save_nb(nb_name):
    
    display(Javascript('IPython.notebook.save_checkpoint();'))
    display(Javascript('IPython.notebook.save_notebook();'))
    print('Saving notebook...', end=' ')

    if _wait_for_save(nb_name):
        print("Saved '{}'.".format(nb_name))
    else:
        logging.warning(
            "Could not save your notebook (timed out waiting for "
            "IPython save). Make sure your notebook is saved "
            "and export again."
        )
1115389
def save(self):
        
        self.get_writer().flush()
        mpc_filename = self.get_writer().get_filename()
        self.get_writer().close()
        self._writer = None
        return mpc_filename
295289
public <S extends Model> ResultKey save(S model) {
        List<Object> columnValues = AnimaUtils.toColumnValues(model, true);
        String       sql          = this.buildInsertSQL(model, columnValues);
        Connection   conn         = getConn();
        try {

            List<Object> params = columnValues.stream()
                    .filter(Objects::nonNull)
                    .collect(toList());

            return new ResultKey(conn.createQuery(sql)
                    .withParams(params)
                    .executeUpdate()
                    .getKey());
        } finally {
            this.closeConn(conn);
            this.clean(conn);
        }
    }
581017
def get_op_or_tensor_by_name(name):
    
    G = tfv1.get_default_graph()

    def f(n):
        if len(n) >= 3 and n[-2] == ':':
            return G.get_tensor_by_name(n)
        else:
            return G.get_operation_by_name(n)

    if not isinstance(name, list):
        return f(name)
    else:
        return list(map(f, name))
188688
private void buildModel() {
    DeepLearningModel cp = null;
    if (checkpoint == null) {
      cp = initModel();
      cp.start_training(null);
    } else {
      final DeepLearningModel previous = UKV.get(checkpoint);
      if (previous == null) throw new IllegalArgumentException("Checkpoint not found.");
      Log.info("Resuming from checkpoint.");
      if (n_folds != 0) {
        throw new UnsupportedOperationException("n_folds must be 0: Cross-validation is not supported during checkpoint restarts.");
      }
      else {
        ((ValidatedJob)previous.job()).xval_models = null; //remove existing cross-validation keys after checkpoint restart
      }
      if (source == null || (previous.model_info().get_params().source != null && !Arrays.equals(source._key._kb, previous.model_info().get_params().source._key._kb))) {
        throw new IllegalArgumentException("source must be the same as for the checkpointed model.");
      }
      autoencoder = previous.model_info().get_params().autoencoder;
      if (!autoencoder && (response == null || !source.names()[source.find(response)].equals(previous.responseName()))) {
        throw new IllegalArgumentException("response must be the same as for the checkpointed model.");
      }
//      if (!autoencoder && (response == null || !Arrays.equals(response._key._kb, previous.model_info().get_params().response._key._kb))) {
//        throw new IllegalArgumentException("response must be the same as for the checkpointed model.");
//      }
      if (Utils.difference(ignored_cols, previous.model_info().get_params().ignored_cols).length != 0
              || Utils.difference(previous.model_info().get_params().ignored_cols, ignored_cols).length != 0) {
        ignored_cols = previous.model_info().get_params().ignored_cols;
        Log.warn("Automatically re-using ignored_cols from the checkpointed model.");
      }
      if ((validation == null) == (previous._validationKey != null)
              || (validation != null && validation._key != null && previous._validationKey != null
              && !Arrays.equals(validation._key._kb, previous._validationKey._kb))) {
        throw new IllegalArgumentException("validation must be the same as for the checkpointed model.");
      }
      if (classification != previous.model_info().get_params().classification) {
        Log.warn("Automatically switching to " + ((classification=!classification) ? "classification" : "regression") + " (same as the checkpointed model).");
      }
      epochs += previous.epoch_counter; //add new epochs to existing model
      Log.info("Adding " + String.format("%.3f", previous.epoch_counter) + " epochs from the checkpointed model.");
      try {
        final DataInfo dataInfo = prepareDataInfo();
        cp = new DeepLearningModel(previous, destination_key, job_key, dataInfo);
        cp.write_lock(self());
        cp.start_training(previous);
        assert(state==JobState.RUNNING);
        final DeepLearning A = cp.model_info().get_params();
        Object B = this;
        for (Field fA : A.getClass().getDeclaredFields()) {
          if (Utils.contains(cp_modifiable, fA.getName())) {
            if (!expert_mode && Utils.contains(expert_options, fA.getName())) continue;
            for (Field fB : B.getClass().getDeclaredFields()) {
              if (fA.equals(fB)) {
                try {
                  if (fB.get(B) == null || fA.get(A) == null || !fA.get(A).toString().equals(fB.get(B).toString())) { // if either of the two parameters is null, skip the toString()
                    if (fA.get(A) == null && fB.get(B) == null) continue; //if both parameters are null, we don't need to do anything
                    Log.info("Applying user-requested modification of '" + fA.getName() + "': " + fA.get(A) + " -> " + fB.get(B));
                    fA.set(A, fB.get(B));
                  }
                } catch (IllegalAccessException e) {
                  e.printStackTrace();
                }
              }
            }
          }
        }
        if (A.n_folds != 0) {
          Log.warn("Disabling cross-validation: Not supported when resuming training from a checkpoint.");
          A.n_folds = 0;
        }
        cp.update(self());
      } finally {
        if (cp != null) cp.unlock(self());
      }
    }
    trainModel(cp);
    cp.stop_training();
  }
478667
public com.google.protobuf.ByteString
      getRestoreOpNameBytes() {
    java.lang.Object ref = restoreOpName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      restoreOpName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }