Browse Source

debugger ui add loading mask and clear torerance

tags/v1.0.0
fengxuefeng 5 years ago
parent
commit
4da15e3f97
2 changed files with 56 additions and 44 deletions
  1. +9
    -5
      mindinsight/ui/src/components/debuggerGridTableSimple.vue
  2. +47
    -39
      mindinsight/ui/src/views/debugger/debugger.vue

+ 9
- 5
mindinsight/ui/src/components/debuggerGridTableSimple.vue View File

@@ -120,7 +120,7 @@ export default {
formateData: [], // formatted data formateData: [], // formatted data
formateArr: [], // formatted Array formateArr: [], // formatted Array
statistics: {}, // Object contain maximun and minimun statistics: {}, // Object contain maximun and minimun
accuracy: 7, // accuracy value
accuracy: 10, // accuracy value
incorrectData: false, // Wheather the dimension is correctly selected incorrectData: false, // Wheather the dimension is correctly selected
updated: false, // Updated updated: false, // Updated
scrollTop: false, // Wheather scroll to the top scrollTop: false, // Wheather scroll to the top
@@ -138,6 +138,9 @@ export default {
{label: 5, value: 5}, {label: 5, value: 5},
{label: 6, value: 6}, {label: 6, value: 6},
{label: 7, value: 7}, {label: 7, value: 7},
{label: 8, value: 8},
{label: 9, value: 9},
{label: 10, value: 10},
], ],
// Table configuration items // Table configuration items
optionObj: { optionObj: {
@@ -495,10 +498,11 @@ export default {
* @param {String} errorMsg Error message * @param {String} errorMsg Error message
* @param {Array} dimension Array of dimension * @param {Array} dimension Array of dimension
* @param {String} filterStr String of dimension selection * @param {String} filterStr String of dimension selection
* @param {Boolean} isUpdate Whether to reset
*/ */
showRequestErrorMessage(errorMsg, dimension, filterStr) {
showRequestErrorMessage(errorMsg, dimension, filterStr, isUpdate) {
this.errorMsg = errorMsg; this.errorMsg = errorMsg;
if (!this.filterArr.length && dimension && filterStr) {
if ((!this.filterArr.length && dimension && filterStr)|| isUpdate) {
this.initializeFilterArr(dimension, filterStr); this.initializeFilterArr(dimension, filterStr);
} }
this.requestError = true; this.requestError = true;
@@ -595,7 +599,7 @@ export default {
} }
} }
.filter-input { .filter-input {
width: 50px;
width: 65px;
text-align: center; text-align: center;
} }
.input-behind { .input-behind {
@@ -610,7 +614,7 @@ export default {
.accuracy-container { .accuracy-container {
float: right; float: right;
.select-item { .select-item {
width: 60px;
width: 65px;
} }
} }
} }


+ 47
- 39
mindinsight/ui/src/views/debugger/debugger.vue View File

@@ -372,7 +372,7 @@ limitations under the License.
<div class="deb-con-title-right"> <div class="deb-con-title-right">
<div class="close-btn"> <div class="close-btn">
<img src="@/assets/images/close-page.png" <img src="@/assets/images/close-page.png"
@click="tensorCompareFlag=false">
@click="tensorCompareFlag=false;dims=null;tolerance=0;">
</div> </div>
</div> </div>


@@ -589,6 +589,8 @@ export default {
if (this.gridType === 'compare') { if (this.gridType === 'compare') {
this.tensorComparisons(this.curRowObj); this.tensorComparisons(this.curRowObj);
} else { } else {
this.dims = null;
this.tolerance = 0;
this.viewValueDetail(this.curRowObj); this.viewValueDetail(this.curRowObj);
} }
}, },
@@ -613,48 +615,54 @@ export default {
}) })
.reverse(), .reverse(),
).replace(/"/g, ''); ).replace(/"/g, '');
this.dims = shape;
const params = { const params = {
name: row.name, name: row.name,
detail: 'data', detail: 'data',
shape, shape,
tolerance: this.tolerance / 100, tolerance: this.tolerance / 100,
}; };
RequestService.tensorComparisons(params).then((res) => {
if (res && res.data && res.data.tensor_value) {
this.tensorCompareFlag = true;
const tensorValue = res.data.tensor_value;
if (
tensorValue.diff &&
tensorValue.diff.includes('Too large to show')
) {
this.tensorValue = [];
this.$nextTick(() => {
this.$refs.tensorValue.showRequestErrorMessage(
this.$t('debugger.largeDataTip'),
JSON.parse(row.shape),
shape,
);
});
return;
}
this.tensorValue = tensorValue.diff;
if (
this.tensorValue &&
this.tensorValue instanceof Array &&
!(this.tensorValue[0] instanceof Array)
) {
this.tensorValue = [this.tensorValue];
}
this.$nextTick(() => {
this.$refs.tensorValue.updateGridData(
this.tensorValue,
JSON.parse(row.shape),
tensorValue.statistics,
shape,
);
});
}
});
const loadingInstance = this.$loading(this.loadingOption);
RequestService.tensorComparisons(params).then(
(res) => {
loadingInstance.close();
if (res && res.data && res.data.tensor_value) {
this.tensorCompareFlag = true;
const tensorValue = res.data.tensor_value;
if (tensorValue.diff === 'Too large to show.') {
this.tensorValue = [];
this.$nextTick(() => {
this.$refs.tensorValue.showRequestErrorMessage(
this.$t('debugger.largeDataTip'),
JSON.parse(row.shape),
shape,
true,
);
});
return;
}
this.tensorValue = tensorValue.diff;
if (
this.tensorValue &&
this.tensorValue instanceof Array &&
!(this.tensorValue[0] instanceof Array)
) {
this.tensorValue = [this.tensorValue];
}
this.$nextTick(() => {
this.$refs.tensorValue.updateGridData(
this.tensorValue,
JSON.parse(row.shape),
tensorValue.statistics,
shape,
);
});
}
},
(err) => {
loadingInstance.close();
},
);
}, },
/** /**
* Initialize the condition * Initialize the condition
@@ -1018,7 +1026,6 @@ export default {
}) })
.reverse(), .reverse(),
).replace(/"/g, ''); ).replace(/"/g, '');
this.dims = shape;
const params = {name: row.name, detail: 'data', shape}; const params = {name: row.name, detail: 'data', shape};
const loadingInstance = this.$loading(this.loadingOption); const loadingInstance = this.$loading(this.loadingOption);
RequestService.tensors(params).then( RequestService.tensors(params).then(
@@ -1029,13 +1036,14 @@ export default {
this.tensorCompareFlag = true; this.tensorCompareFlag = true;
if (res.data.tensor_value) { if (res.data.tensor_value) {
const value = res.data.tensor_value.value; const value = res.data.tensor_value.value;
if (value.includes('Too large to show')) {
if (value === 'Too large to show.') {
this.tensorValue = []; this.tensorValue = [];
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.tensorValue.showRequestErrorMessage( this.$refs.tensorValue.showRequestErrorMessage(
this.$t('debugger.largeDataTip'), this.$t('debugger.largeDataTip'),
JSON.parse(row.shape), JSON.parse(row.shape),
shape, shape,
true,
); );
}); });
return; return;


Loading…
Cancel
Save