Skip to content
Advertisement

Removal of data /indices values(range) from a tensor tensorflow

Consider the following tensor

JavaScript

The output of the above tensor is

JavaScript

Now I want to remove, lets say the first value , i.e., 1.3, remove values from indices starting from 4 to 6 and from value 0.25 onwards [12:] The output shall be

JavaScript

Can it be done? Thanks in advance

Advertisement

Answer

Sure, have a look at tensor slicing. In your case it would be:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement