How to merge a pair of 2d tensors at different positions for each rowHow to print the value of a Tensor object in TensorFlow?How can we replace a single element in an n-D Tensor in TensorFlow?How to select rows from a 3-D Tensor in TensorFlow?In TensorFlow, how can I selectively apply a function only to the maximum elements of each row of a tensor?Keep specific tensor row chunks in tensorflowHow to get slices of different dimensions from tensorflow tensor.How to select different columns from each row in tensor in tensorflow?Tensorflow - how to use same dropout mask at each rowreturn the top_k masked softmax of each row for a 2D tensorHow to delete different rows of a 3D tensor

Term for anticipating counterarguments and rebutting them

What is the difference between democracy and ochlocracy?

Why did the people of Zion never find evidence of the previous cycles?

Why does the Joker do this to Bob?

How to move a paragraph and paste it without an initial newline first

Why is my plastic credit card and activation code sent separately?

How does kinetic energy work in braking a vehicle?

Does Dim Light created by an effect override Bright Light in an area?

Right Ascension for epoch 2000 - physical location?

Can you put L trominos to fill the figure?

How to convert this term to a Hypergeometric function?

Why is more music written in sharp keys than flat keys?

Noise reduction using multiple recordings of the same signal

Artificially isolated pawn in the Caro-Kann

For a command to increase something, should instructions refer to the "+" key or the "=" key?

Why do microwaves use magnetron?

Why do we use the Greek letter μ (Mu) to denote population mean or expected value in probability and statistics

Is the ''yoi'' meaning ''ready'' when doing karate the same as the ''yoi'' which means nice/good?

How can an immortal member of the nobility be prevented from taking the throne?

How can Edward Snowden be denied a jury trial?

How to deal with non-stop callers in the service desk

What techniques can I use to seduce a PC without arousing suspicion of ulterior motives?

What type of key profile is this?

What's a good strategy for offering low on a house?



How to merge a pair of 2d tensors at different positions for each row


How to print the value of a Tensor object in TensorFlow?How can we replace a single element in an n-D Tensor in TensorFlow?How to select rows from a 3-D Tensor in TensorFlow?In TensorFlow, how can I selectively apply a function only to the maximum elements of each row of a tensor?Keep specific tensor row chunks in tensorflowHow to get slices of different dimensions from tensorflow tensor.How to select different columns from each row in tensor in tensorflow?Tensorflow - how to use same dropout mask at each rowreturn the top_k masked softmax of each row for a 2D tensorHow to delete different rows of a 3D tensor






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0

















Desired behavior:



t1 = [[1, 2, 0], [3, 0, 0]]
t2 = [[4, 0, 0], [5, 6, 1]]
t3 = tf.magical_op(t1, t2)


With the result being that



t3 = [[1, 2, 4], [3, 5, 6]]


In words, I need to replace the 0s in t1 with elements from t2.
Matching the first 0 in a row of t1 with the first element in the same row of t2,
and for the second 0 the second element of t2, etc.










share|improve this question
































    0

















    Desired behavior:



    t1 = [[1, 2, 0], [3, 0, 0]]
    t2 = [[4, 0, 0], [5, 6, 1]]
    t3 = tf.magical_op(t1, t2)


    With the result being that



    t3 = [[1, 2, 4], [3, 5, 6]]


    In words, I need to replace the 0s in t1 with elements from t2.
    Matching the first 0 in a row of t1 with the first element in the same row of t2,
    and for the second 0 the second element of t2, etc.










    share|improve this question




























      0












      0








      0








      Desired behavior:



      t1 = [[1, 2, 0], [3, 0, 0]]
      t2 = [[4, 0, 0], [5, 6, 1]]
      t3 = tf.magical_op(t1, t2)


      With the result being that



      t3 = [[1, 2, 4], [3, 5, 6]]


      In words, I need to replace the 0s in t1 with elements from t2.
      Matching the first 0 in a row of t1 with the first element in the same row of t2,
      and for the second 0 the second element of t2, etc.










      share|improve this question















      Desired behavior:



      t1 = [[1, 2, 0], [3, 0, 0]]
      t2 = [[4, 0, 0], [5, 6, 1]]
      t3 = tf.magical_op(t1, t2)


      With the result being that



      t3 = [[1, 2, 4], [3, 5, 6]]


      In words, I need to replace the 0s in t1 with elements from t2.
      Matching the first 0 in a row of t1 with the first element in the same row of t2,
      and for the second 0 the second element of t2, etc.







      tensorflow






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 21:38









      JeffJeff

      11 bronze badge




      11 bronze badge

























          0






          active

          oldest

          votes













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407233%2fhow-to-merge-a-pair-of-2d-tensors-at-different-positions-for-each-row%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407233%2fhow-to-merge-a-pair-of-2d-tensors-at-different-positions-for-each-row%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript