Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pytorch rolling window

import torch

x = torch.arange(10)#tensor([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9])
x.unfold(0,4,3) #Tensor.unfold(dimension, window_size, step) 

'''tensor([[0, 1, 2, 3],
        [3, 4, 5, 6],
        [6, 7, 8, 9]])'''
Comment

PREVIOUS NEXT
Code Example
Python :: convert string to double 2 decimal places python 
Python :: pandas show all columns 
Python :: remove punctuation and special charaacters nltk 
Python :: use an async check function for discord.py wait_for? 
Python :: multiply two list in python using lambda 
Python :: mechanize python XE #26 
Python :: how to print multiple lines in one line python 
Python :: python import shelve 
Python :: snake game using python 
Python :: help with given object return documentation 
Python :: python sys replace text 
Python :: how to simulate a keypress using pyautogui 
Python :: read(stdin, buf) ctf 
Python :: .format() multiple placeholders 
Python :: scipy z value to pvalue 
Python :: pairplot hide original legend 
Python :: splitting Feature and target using iloc 
Python :: saving a dta file 
Python :: Python Anagram Using sorted() function 
Python :: Python String count() Implementation of the count() method using optional parameters 
Python :: how to return and use a single object in custom template filters django 
Python :: NO OF CLASSES IN PAVIA UNIV DATASET 
Python :: python to uml 
Python :: convert float array to integer 
Python :: Explaining async session in requests-html 
Python :: seasonal plot python 
Python :: Python NumPy asarray Function Example list to array 
Python :: how to kill python program 
Python :: Stacked or grouped bar char python 
Python :: NumPy rot90 Example Rotating Twice 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =