Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,87 +37,104 @@ export class ExecutionDataContainer {
@Input()
focusedExecutionIndex!: number;

readonly focusedExecutionData$ = this.store.pipe(
select(getFocusedExecutionData)
);
readonly focusedExecutionData$;

readonly tensorDebugMode$ = this.store.pipe(
select(
createSelector(getFocusedExecutionData, (execution: Execution | null) => {
if (execution === null) {
return TensorDebugMode.UNSPECIFIED;
} else {
return execution.tensor_debug_mode;
}
})
)
);
readonly tensorDebugMode$;

readonly hasDebugTensorValues$ = this.store.pipe(
select(
createSelector(getFocusedExecutionData, (execution: Execution | null) => {
if (execution === null || execution.debug_tensor_values === null) {
return false;
} else {
for (const singleDebugTensorValues of execution.debug_tensor_values) {
if (
singleDebugTensorValues !== null &&
singleDebugTensorValues.length > 0
) {
return true;
}
}
return false;
}
})
)
);
readonly hasDebugTensorValues$;

readonly debugTensorValues$;

readonly debugTensorValues$ = this.store.pipe(
select(
createSelector(getFocusedExecutionData, (execution: Execution | null) => {
if (execution === null) {
return null;
} else {
return execution.debug_tensor_values;
}
})
)
);
readonly debugTensorDtypes$;

readonly debugTensorDtypes$ = this.store.pipe(
select(
createSelector(
getFocusedExecutionData,
(execution: Execution | null): string[] | null => {
if (execution === null || execution.debug_tensor_values === null) {
return null;
}
if (
execution.tensor_debug_mode !== TensorDebugMode.FULL_HEALTH &&
execution.tensor_debug_mode !== TensorDebugMode.SHAPE
) {
// TODO(cais): Add logic for other TensorDebugModes with dtype info.
return null;
}
const dtypes: string[] = [];
for (const tensorValue of execution.debug_tensor_values) {
if (tensorValue === null) {
dtypes.push(UNKNOWN_DTYPE_NAME);
constructor(private readonly store: Store<State>) {
this.focusedExecutionData$ = this.store.pipe(
select(getFocusedExecutionData),
);
this.tensorDebugMode$ = this.store.pipe(
select(
createSelector(
getFocusedExecutionData,
(execution: Execution | null) => {
if (execution === null) {
return TensorDebugMode.UNSPECIFIED;
} else {
const dtypeEnum = String(
execution.tensor_debug_mode === TensorDebugMode.FULL_HEALTH
? tensorValue[2] // tensor_debug_mode: FULL_HEALTH
: tensorValue[1] // tensor_debug_mode: SHAPE
);
dtypes.push(DTYPE_ENUM_TO_NAME[dtypeEnum] || UNKNOWN_DTYPE_NAME);
return execution.tensor_debug_mode;
}
}
return dtypes;
}
)
)
);

constructor(private readonly store: Store<State>) {}
},
),
),
);
this.hasDebugTensorValues$ = this.store.pipe(
select(
createSelector(
getFocusedExecutionData,
(execution: Execution | null) => {
if (execution === null || execution.debug_tensor_values === null) {
return false;
} else {
for (const singleDebugTensorValues of execution.debug_tensor_values) {
if (
singleDebugTensorValues !== null &&
singleDebugTensorValues.length > 0
) {
return true;
}
}
return false;
}
},
),
),
);
this.debugTensorValues$ = this.store.pipe(
select(
createSelector(
getFocusedExecutionData,
(execution: Execution | null) => {
if (execution === null) {
return null;
} else {
return execution.debug_tensor_values;
}
},
),
),
);
this.debugTensorDtypes$ = this.store.pipe(
select(
createSelector(
getFocusedExecutionData,
(execution: Execution | null): string[] | null => {
if (execution === null || execution.debug_tensor_values === null) {
return null;
}
if (
execution.tensor_debug_mode !== TensorDebugMode.FULL_HEALTH &&
execution.tensor_debug_mode !== TensorDebugMode.SHAPE
) {
// TODO(cais): Add logic for other TensorDebugModes with dtype info.
return null;
}
const dtypes: string[] = [];
for (const tensorValue of execution.debug_tensor_values) {
if (tensorValue === null) {
dtypes.push(UNKNOWN_DTYPE_NAME);
} else {
const dtypeEnum = String(
execution.tensor_debug_mode === TensorDebugMode.FULL_HEALTH
? tensorValue[2] // tensor_debug_mode: FULL_HEALTH
: tensorValue[1], // tensor_debug_mode: SHAPE
);
dtypes.push(
DTYPE_ENUM_TO_NAME[dtypeEnum] || UNKNOWN_DTYPE_NAME,
);
}
}
return dtypes;
},
),
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@ import {State} from '../../store/debugger_types';
`,
})
export class GraphContainer {
readonly opInfo$ = this.store.pipe(select(getFocusedGraphOpInfo));
readonly opInfo$;

readonly inputOps$ = this.store.pipe(select(getFocusedGraphOpInputs));
readonly inputOps$;

readonly consumerOps$ = this.store.pipe(select(getFocusedGraphOpConsumers));
readonly consumerOps$;

onGraphOpNavigate(event: {graph_id: string; op_name: string}) {
this.store.dispatch(graphOpFocused(event));
}

constructor(private readonly store: Store<State>) {}
constructor(private readonly store: Store<State>) {
this.opInfo$ = this.store.pipe(select(getFocusedGraphOpInfo));
this.inputOps$ = this.store.pipe(select(getFocusedGraphOpInputs));
this.consumerOps$ = this.store.pipe(select(getFocusedGraphOpConsumers));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ import {State as DebuggerState} from '../../store/debugger_types';
`,
})
export class SourceFilesContainer {
constructor(private readonly store: Store<DebuggerState & OtherAppState>) {}
constructor(private readonly store: Store<DebuggerState & OtherAppState>) {
this.focusedSourceFileContent$ = this.store.select(
getFocusedSourceFileContent,
);
this.focusedSourceLineSpec$ = this.store.select(getFocusedSourceLineSpec);
this.useDarkMode$ = this.store.select(getDarkModeEnabled);
}

readonly focusedSourceFileContent$ = this.store.select(
getFocusedSourceFileContent
);
readonly focusedSourceFileContent$;

readonly focusedSourceLineSpec$ = this.store.select(getFocusedSourceLineSpec);
readonly focusedSourceLineSpec$;

readonly useDarkMode$: Observable<boolean> =
this.store.select(getDarkModeEnabled);
readonly useDarkMode$: Observable<boolean>;
}
Loading
Loading