Spaces:
Build error
Build error
Download util/lua/nn/test_Crop.lua from rawanessam/FloorPlanTransformation: direct link, hf CLI and curl.
- Browser
- Download file 260 Bytes
-
https://huggingface.co/spaces/rawanessam/FloorPlanTransformation/resolve/main/util/lua/nn/test_Crop.lua
- Command line
-
hf download hf://spaces/rawanessam/FloorPlanTransformation/util/lua/nn/test_Crop.lua
-
curl -L -o test_Crop.lua https://huggingface.co/spaces/rawanessam/FloorPlanTransformation/resolve/main/util/lua/nn/test_Crop.lua
260 Bytes
| require 'nn' | |
| require 'Crop' | |
| a = nn.Crop(8, 6, 4, 3) | |
| x = torch.rand(1, 1, 6, 8) | |
| y = torch.Tensor(1, 2, 2) | |
| y[1][1][1] = 2 | |
| y[1][1][2] = 3 | |
| y[1][2][1] = 5 | |
| y[1][2][2] = 2 | |
| t = {} | |
| t[1] = x | |
| t[2] = y | |
| z = a:forward(t) | |
| w = a:backward(t, z) | |
| print(x) | |
| print(z) | |
| print(w) | |