question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add empty input to a node

See original GitHub issue

hi~Now I am adding a fuse pass

Now I have encountered a problem, how to add an empty input to a node, Node->addInput seems to be unable to add an empty input

Call the following api in python

node_def = helper.make_node(
    'Attention', # node name
    ['p2o.Add.6', 'qkv_weights', 'qkv_bias', '', '', 'extra_add_qk'],
    # ['p2o.Add.6', 'qkv_weights', 'qkv_bias', 'mask_index'],
    ['Y'], # outputs
    name='Attention',
    domain="com.microsoft",
    # attributes
    num_heads=9,
    unidirectional=0,
    )

You can create an Attention node with empty fourth and fifth inputs: image

How to create it in C++,thanks a lot~

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
HSQ79815commented, Jul 12, 2022

@wjj19950828

auto* empty_node = g->create(kUndefined, 1);
empty_node->output()->setUniqueName(""); // empty_node->output() is a `Value` that represents a empty tensor 

empty_node->insertBefore(node); // insert empty_node to node lists that should be topo sort

node->addInput(empty_node->output())

Are you able to use the above codes to verifying again ?

1reaction
HSQ79815commented, Jul 11, 2022

@wjj19950828 Great, I will debug it sooner

Read more comments on GitHub >

github_iconTop Results From Across the Web

Input Empty String In NodeJS - javascript - Stack Overflow
I want to check if the user is trying to input a empty string in the registration ... Are you sure the values...
Read more >
How To Add Validation For Empty Input Field with JavaScript
Step 2) Add JavaScript: If an input field (fname) is empty, this function alerts a message, and returns false, to prevent the form...
Read more >
Support for continuing execution of nodes with empty input
To add a node option “continue on empty”. Which outputs one empty item if a node returns null (which stops the execution).
Read more >
Linked Lists 9: Adding to an Empty List - YouTube
In this video, we take up the challenge of adding to the end of an empty list.
Read more >
Empty Table Switch - NodePit
Empty Table Switch ... Sends input data to first output if and only if it is not empty. If there are no rows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found