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

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현