Skip to content
Snippets Groups Projects
Commit 60f93272 authored by Daniel Povey's avatar Daniel Povey Committed by GitHub
Browse files

[build,src,doc] Modify get_version.sh to deal better with whitespace (avoid...

[build,src,doc] Modify get_version.sh to deal better with whitespace (avoid space in version); minor fixes (#1526)
parent e8ca375d
No related branches found
No related tags found
No related merge requests found
......@@ -54,20 +54,20 @@ elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" != true ]; then
echo "$0: Using the version number \"$version\" specified in src/.version."
else
# Figure out patch number.
version_commit=$(git log -1 --pretty=oneline ../.version | cut -f 1 -d ' ')
patch_number=$(git rev-list ${version_commit}..HEAD | wc -l)
version_commit=$(git log -1 --pretty=oneline ../.version | awk '{print $1}')
patch_number=$(git rev-list ${version_commit}..HEAD | wc -l | awk '{print $1}')
version="$version.$patch_number"
# Check for uncommitted changes in src/.
uncommitted_changes=$(git diff-index HEAD -- .. | wc -l)
uncommitted_changes=$(git diff-index HEAD -- .. | wc -l | awk '{print $1}')
if [ $uncommitted_changes -gt 0 ]; then
# Add suffix ~N if there are N files in src/ with uncommitted changes
version="$version~$uncommitted_changes"
fi
# Figure out HEAD commit SHA-1.
head_commit=$(git log -1 --pretty=oneline | cut -f 1 -d ' ')
head_commit_short=$(git log -1 --oneline --abbrev=4 | cut -f 1 -d ' ')
head_commit=$(git log -1 --pretty=oneline | awk '{print $1}')
head_commit_short=$(git log -1 --oneline --abbrev=4 | awk '{print $1}')
version="$version-${head_commit_short}"
fi
......
......@@ -30,7 +30,7 @@ void ComputeChainObjfAndDeriv(const ChainTrainingOptions &opts,
const Supervision &supervision,
const CuMatrixBase<BaseFloat> &nnet_output,
BaseFloat *objf,
BaseFloat *l2_term,
BaseFloat *l2_term,
BaseFloat *weight,
CuMatrixBase<BaseFloat> *nnet_output_deriv,
CuMatrixBase<BaseFloat> *xent_output_deriv) {
......@@ -86,7 +86,7 @@ void ComputeChainObjfAndDeriv(const ChainTrainingOptions &opts,
// for different frames of the sequences. As expected, they are
// smaller towards the edges of the sequences (due to the penalization
// of 'incorrect' pdf-ids.
if (GetVerboseLevel() >= 1) {
if (GetVerboseLevel() >= 1 && nnet_output_deriv != NULL) {
int32 tot_frames = nnet_output_deriv->NumRows(),
frames_per_sequence = supervision.frames_per_sequence,
num_sequences = supervision.num_sequences;
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment