Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

src: allow operators to access graph in initialization #227

Merged
merged 2 commits into from
Nov 18, 2020

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Sep 8, 2020

By accessing the graph ( already resolved and finalized ) in operator's initialization, it is possible to access the tensor value of the operator's input, if it's the graph's initializer or const value. This will enable implementation of upcoming operators that want to deal with constant inputs.

*/
resolve(node: Graph.Node, opsets: ReadonlyArray<OpSet>, graph: Graph): Operator;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: not that different, but make graph as optional?

import {Tensor} from './tensor';

export interface Operator {
initialize(attributes: Attribute): void;
initialize(attributes: Attribute, node: Graph.Node, graph: Graph): void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. node and graph as optional?

@hanbitmyths hanbitmyths self-requested a review September 16, 2020 07:25
@hanbitmyths hanbitmyths self-assigned this Sep 16, 2020
@fs-eire fs-eire merged commit b69fb02 into master Nov 18, 2020
@fs-eire fs-eire deleted the allow-access-graph-op-init branch November 18, 2020 22:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants