# Path: test/test_helpers.py
# def myeval(expr):
#     parent_vars = inspect.stack()[1][0].f_locals
#     print(expr, ':', eval(expr, parent_vars))
# 
# def myexec(expr):
#     parent_vars = inspect.stack()[1][0].f_locals
#     print(expr)
#     exec(expr, parent_vars)


import PyTorch
import numpy
import inspect
from test.test_helpers import myeval, myexec
    PyTorch.manualSeed(3)
    print(PyTorch.LongTensor(3, 4).geometric())

    print(type(PyTorch.LongTensor(2, 3)))

    size = PyTorch.LongStorage(2)
    size[0] = 4
    size[1] = 3
    D.resize(size)
    print('D after resize:\n', D)

    print('resize1d', PyTorch.LongTensor().resize1d(3).fill(1))
    print('resize2d', PyTorch.LongTensor().resize2d(2, 3).fill(1))
    print('resize', PyTorch.LongTensor().resize(size).fill(1))

    D = PyTorch.LongTensor(size).geometric()

#    def myeval(expr):
#        print(expr, ':', eval(expr))

#    def myexec(expr):
#        print(expr)
#        exec(expr)

    myeval('LongTensor(3,2).nElement()')
    myeval('LongTensor().nElement()')
    myeval('LongTensor(1).nElement()')

    A = LongTensor(3, 4).geometric(0.9)
    myeval('A')

# Path: test/test_helpers.py
# def myeval(expr):
#     parent_vars = inspect.stack()[1][0].f_locals
#     print(expr, ':', eval(expr, parent_vars))
# 
# def myexec(expr):
#     parent_vars = inspect.stack()[1][0].f_locals
#     print(expr)
#     exec(expr, parent_vars)


# Path: test/test_pytorch.py
import PyTorch
import numpy
import inspect
from test.test_helpers import myeval, myexec

    PyTorch.manualSeed(3)
    print(PyTorch.LongTensor(3, 4).geometric())

    print(type(PyTorch.LongTensor(2, 3)))

    size = PyTorch.LongStorage(2)
    size[0] = 4
    size[1] = 3
    D.resize(size)
    print('D after resize:\n', D)

    print('resize1d', PyTorch.LongTensor().resize1d(3).fill(1))
    print('resize2d', PyTorch.LongTensor().resize2d(2, 3).fill(1))
    print('resize', PyTorch.LongTensor().resize(size).fill(1))

    D = PyTorch.LongTensor(size).geometric()

#    def myeval(expr):
#        print(expr, ':', eval(expr))

#    def myexec(expr):
#        print(expr)
#        exec(expr)

    myeval('LongTensor(3,2).nElement()')
    myeval('LongTensor().nElement()')
    myeval('LongTensor(1).nElement()')

    A = LongTensor(3, 4).geometric(0.9)
    myeval('A')

    myexec('A += 3')