We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Enabled RandomResizedCrop batch mode when same_on_batch=False
### Description

#680

The previous implementation would crop the same size then resize. This PR enabled different cropped sizes across the batch.

<img width="1028" alt="Screenshot 2020-09-15 at 11 18 54 PM" src="https://user-images.githubusercontent.com/15955486/93230317-1f4f1980-f7aa-11ea-9f07-bb85c2bab50f.png">



### Status
**Ready/Work in progress/Hold**

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not applicable items -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or new feature that would cause existing functionality to change)
- [ ] New tests added to cover the changes
- [ ] Docstrings/Documentation updated


## PR Checklist
### PR Implementer
This is a small checklist for the implementation details of this PR.

If there are any questions regarding code style or other conventions check out our 
[summary](https://github.com/kornia/kornia/blob/master/CONTRIBUTING.rst).

- [ ] Did you discuss the functionality or any breaking changes before ?
- [ ] **Pass all tests**: did you test in local ? `make test`
- [ ] Unittests: did you add tests for your new functionality ?
- [ ] Documentations: did you build documentation ? `make build-docs`
- [ ] Implementation: is your code well commented and follow conventions ? `make lint`
- [ ] Docstrings & Typing: has your code documentation and typing ? `make mypy`
- [ ] Update notebooks & documentation if necessary

### KorniaTeam
<details>
  <summary>KorniaTeam workflow</summary>
  
  - [ ] Assign correct label
  - [ ] Assign PR to a reviewer
  - [ ] Does this PR close an Issue? (add `closes #IssueNumber` at the bottom if 
        not already in description)

</details>

### Reviewer
<details>
  <summary>Reviewer workflow</summary>

  - [ ] Do all tests pass? (Unittests, Typing, Linting, Documentation, Environment)
  - [ ] Does the implementation follow `kornia` design conventions?
  - [ ] Is the documentation complete enough ?
  - [ ] Are the tests covering simple and corner cases ?
 
</details>


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `kornia/geometry/homography.py`
Content:
```
1 import warnings
2 
3 import torch
4 from typing import Tuple, Optional
5 
6 import kornia
7 from kornia.geometry.epipolar import normalize_points
8 
9 TupleTensor = Tuple[torch.Tensor, torch.Tensor]
10 
11 
12 def find_homography_dlt(
13         points1: torch.Tensor, points2: torch.Tensor, weights: Optional[torch.Tensor] = None) -> torch.Tensor:
14     r"""Computes the homography matrix using the DLT formulation.
15 
16     The linear system is solved by using the Weighted Least Squares Solution for the 4 Points algorithm.
17 
18     Args:
19         points1 (torch.Tensor): A set of points in the first image with a tensor shape :math:`(B, N, 2)`.
20         points2 (torch.Tensor): A set of points in the second image with a tensor shape :math:`(B, N, 2)`.
21         weights (torch.Tensor, optional): Tensor containing the weights per point correspondence with a shape of
22                 :math:`(B, N)`. Defaults to all ones.
23 
24     Returns:
25         torch.Tensor: the computed homography matrix with shape :math:`(B, 3, 3)`.
26     """
27     assert points1.shape == points2.shape, points1.shape
28     assert len(points1.shape) >= 1 and points1.shape[-1] == 2, points1.shape
29     assert points1.shape[1] >= 4, points1.shape
30 
31     eps: float = 1e-8
32     points1_norm, transform1 = normalize_points(points1)
33     points2_norm, transform2 = normalize_points(points2)
34 
35     x1, y1 = torch.chunk(points1_norm, dim=-1, chunks=2)  # BxNx1
36     x2, y2 = torch.chunk(points2_norm, dim=-1, chunks=2)  # BxNx1
37     ones, zeros = torch.ones_like(x1), torch.zeros_like(x1)
38 
39     # DIAPO 11: https://www.uio.no/studier/emner/matnat/its/nedlagte-emner/UNIK4690/v16/forelesninger/lecture_4_3-estimating-homographies-from-feature-correspondences.pdf  # noqa: E501
40     ax = torch.cat([zeros, zeros, zeros, -x1, -y1, -ones, y2 * x1, y2 * y1, y2], dim=-1)
41     ay = torch.cat([x1, y1, ones, zeros, zeros, zeros, -x2 * x1, -x2 * y1, -x2], dim=-1)
42     A = torch.cat((ax, ay), dim=-1).reshape(ax.shape[0], -1, ax.shape[-1])
43 
44     if weights is None:
45         # All points are equally important
46         A = A.transpose(-2, -1) @ A
47     else:
48         # We should use provided weights
49         assert len(weights.shape) == 2 and weights.shape == points1.shape[:2], weights.shape
50         w_diag = torch.diag_embed(weights.repeat(1, 2))
51         A = A.transpose(-2, -1) @ w_diag @ A
52 
53     try:
54         U, S, V = torch.svd(A)
55     except:
56         warnings.warn('SVD did not converge', RuntimeWarning)
57         return torch.empty((points1_norm.size(0), 3, 3), device=points1.device)
58 
59     H = V[..., -1].view(-1, 3, 3)
60     H = transform2.inverse() @ (H @ transform1)
61     H_norm = H / (H[..., -1:, -1:] + eps)
62     return H_norm
63 
64 
65 def find_homography_dlt_iterated(points1: torch.Tensor,
66                                  points2: torch.Tensor,
67                                  weights: torch.Tensor,
68                                  soft_inl_th: float = 3.0,
69                                  n_iter: int = 5) -> torch.Tensor:
70     r"""Computes the homography matrix using the iteratively-reweighted least squares (IRWLS).
71 
72     The linear system is solved by using the Reweighted Least Squares Solution for the 4 Points algorithm.
73 
74     Args:
75         points1 (torch.Tensor): A set of points in the first image with a tensor shape :math:`(B, N, 2)`.
76         points2 (torch.Tensor): A set of points in the second image with a tensor shape :math:`(B, N, 2)`.
77         weights (torch.Tensor): Tensor containing the weights per point correspondence with a shape of :math:`(B, N)`.
78           Used for the first iteration of the IRWLS.
79         soft_inl_th (float): Soft inlier threshold used for weight calculation.
80         n_iter (int): number of iterations. Default is 5.
81 
82     Returns:
83         torch.Tensor: the computed homography matrix with shape :math:`(B, 3, 3)`.
84     """
85 
86     '''Function, which finds homography via iteratively-reweighted
87     least squares ToDo: add citation'''
88     H: torch.Tensor = find_homography_dlt(points1, points2, weights)
89     for i in range(n_iter - 1):
90         pts1_in_2: torch.Tensor = kornia.transform_points(H, points1)
91         error_squared: torch.Tensor = (pts1_in_2 - points2).pow(2).sum(dim=-1)
92         weights_new: torch.Tensor = torch.exp(-error_squared / (2.0 * (soft_inl_th ** 2)))
93         H = find_homography_dlt(points1, points2, weights_new)
94     return H
95
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/kornia/geometry/homography.py b/kornia/geometry/homography.py
--- a/kornia/geometry/homography.py
+++ b/kornia/geometry/homography.py
@@ -47,7 +47,7 @@
     else:
         # We should use provided weights
         assert len(weights.shape) == 2 and weights.shape == points1.shape[:2], weights.shape
-        w_diag = torch.diag_embed(weights.repeat(1, 2))
+        w_diag = torch.diag_embed(weights.unsqueeze(dim=-1).repeat(1, 1, 2).reshape(weights.shape[0], -1))
         A = A.transpose(-2, -1) @ w_diag @ A
 
     try:

{"golden_diff": "diff --git a/kornia/geometry/homography.py b/kornia/geometry/homography.py\n--- a/kornia/geometry/homography.py\n+++ b/kornia/geometry/homography.py\n@@ -47,7 +47,7 @@\n     else:\n         # We should use provided weights\n         assert len(weights.shape) == 2 and weights.shape == points1.shape[:2], weights.shape\n-        w_diag = torch.diag_embed(weights.repeat(1, 2))\n+        w_diag = torch.diag_embed(weights.unsqueeze(dim=-1).repeat(1, 1, 2).reshape(weights.shape[0], -1))\n         A = A.transpose(-2, -1) @ w_diag @ A\n \n     try:\n", "issue": "Enabled RandomResizedCrop batch mode when same_on_batch=False\n### Description\r\n\r\n#680\r\n\r\nThe previous implementation would crop the same size then resize. This PR enabled different cropped sizes across the batch.\r\n\r\n<img width=\"1028\" alt=\"Screenshot 2020-09-15 at 11 18 54 PM\" src=\"https://user-images.githubusercontent.com/15955486/93230317-1f4f1980-f7aa-11ea-9f07-bb85c2bab50f.png\">\r\n\r\n\r\n\r\n### Status\r\n**Ready/Work in progress/Hold**\r\n\r\n### Types of changes\r\n<!--- Put an `x` in all the boxes that apply, and remove the not applicable items -->\r\n- [x] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] Breaking change (fix or new feature that would cause existing functionality to change)\r\n- [ ] New tests added to cover the changes\r\n- [ ] Docstrings/Documentation updated\r\n\r\n\r\n## PR Checklist\r\n### PR Implementer\r\nThis is a small checklist for the implementation details of this PR.\r\n\r\nIf there are any questions regarding code style or other conventions check out our \r\n[summary](https://github.com/kornia/kornia/blob/master/CONTRIBUTING.rst).\r\n\r\n- [ ] Did you discuss the functionality or any breaking changes before ?\r\n- [ ] **Pass all tests**: did you test in local ? `make test`\r\n- [ ] Unittests: did you add tests for your new functionality ?\r\n- [ ] Documentations: did you build documentation ? `make build-docs`\r\n- [ ] Implementation: is your code well commented and follow conventions ? `make lint`\r\n- [ ] Docstrings & Typing: has your code documentation and typing ? `make mypy`\r\n- [ ] Update notebooks & documentation if necessary\r\n\r\n### KorniaTeam\r\n<details>\r\n  <summary>KorniaTeam workflow</summary>\r\n  \r\n  - [ ] Assign correct label\r\n  - [ ] Assign PR to a reviewer\r\n  - [ ] Does this PR close an Issue? (add `closes #IssueNumber` at the bottom if \r\n        not already in description)\r\n\r\n</details>\r\n\r\n### Reviewer\r\n<details>\r\n  <summary>Reviewer workflow</summary>\r\n\r\n  - [ ] Do all tests pass? (Unittests, Typing, Linting, Documentation, Environment)\r\n  - [ ] Does the implementation follow `kornia` design conventions?\r\n  - [ ] Is the documentation complete enough ?\r\n  - [ ] Are the tests covering simple and corner cases ?\r\n \r\n</details>\r\n\n", "before_files": [{"content": "import warnings\n\nimport torch\nfrom typing import Tuple, Optional\n\nimport kornia\nfrom kornia.geometry.epipolar import normalize_points\n\nTupleTensor = Tuple[torch.Tensor, torch.Tensor]\n\n\ndef find_homography_dlt(\n        points1: torch.Tensor, points2: torch.Tensor, weights: Optional[torch.Tensor] = None) -> torch.Tensor:\n    r\"\"\"Computes the homography matrix using the DLT formulation.\n\n    The linear system is solved by using the Weighted Least Squares Solution for the 4 Points algorithm.\n\n    Args:\n        points1 (torch.Tensor): A set of points in the first image with a tensor shape :math:`(B, N, 2)`.\n        points2 (torch.Tensor): A set of points in the second image with a tensor shape :math:`(B, N, 2)`.\n        weights (torch.Tensor, optional): Tensor containing the weights per point correspondence with a shape of\n                :math:`(B, N)`. Defaults to all ones.\n\n    Returns:\n        torch.Tensor: the computed homography matrix with shape :math:`(B, 3, 3)`.\n    \"\"\"\n    assert points1.shape == points2.shape, points1.shape\n    assert len(points1.shape) >= 1 and points1.shape[-1] == 2, points1.shape\n    assert points1.shape[1] >= 4, points1.shape\n\n    eps: float = 1e-8\n    points1_norm, transform1 = normalize_points(points1)\n    points2_norm, transform2 = normalize_points(points2)\n\n    x1, y1 = torch.chunk(points1_norm, dim=-1, chunks=2)  # BxNx1\n    x2, y2 = torch.chunk(points2_norm, dim=-1, chunks=2)  # BxNx1\n    ones, zeros = torch.ones_like(x1), torch.zeros_like(x1)\n\n    # DIAPO 11: https://www.uio.no/studier/emner/matnat/its/nedlagte-emner/UNIK4690/v16/forelesninger/lecture_4_3-estimating-homographies-from-feature-correspondences.pdf  # noqa: E501\n    ax = torch.cat([zeros, zeros, zeros, -x1, -y1, -ones, y2 * x1, y2 * y1, y2], dim=-1)\n    ay = torch.cat([x1, y1, ones, zeros, zeros, zeros, -x2 * x1, -x2 * y1, -x2], dim=-1)\n    A = torch.cat((ax, ay), dim=-1).reshape(ax.shape[0], -1, ax.shape[-1])\n\n    if weights is None:\n        # All points are equally important\n        A = A.transpose(-2, -1) @ A\n    else:\n        # We should use provided weights\n        assert len(weights.shape) == 2 and weights.shape == points1.shape[:2], weights.shape\n        w_diag = torch.diag_embed(weights.repeat(1, 2))\n        A = A.transpose(-2, -1) @ w_diag @ A\n\n    try:\n        U, S, V = torch.svd(A)\n    except:\n        warnings.warn('SVD did not converge', RuntimeWarning)\n        return torch.empty((points1_norm.size(0), 3, 3), device=points1.device)\n\n    H = V[..., -1].view(-1, 3, 3)\n    H = transform2.inverse() @ (H @ transform1)\n    H_norm = H / (H[..., -1:, -1:] + eps)\n    return H_norm\n\n\ndef find_homography_dlt_iterated(points1: torch.Tensor,\n                                 points2: torch.Tensor,\n                                 weights: torch.Tensor,\n                                 soft_inl_th: float = 3.0,\n                                 n_iter: int = 5) -> torch.Tensor:\n    r\"\"\"Computes the homography matrix using the iteratively-reweighted least squares (IRWLS).\n\n    The linear system is solved by using the Reweighted Least Squares Solution for the 4 Points algorithm.\n\n    Args:\n        points1 (torch.Tensor): A set of points in the first image with a tensor shape :math:`(B, N, 2)`.\n        points2 (torch.Tensor): A set of points in the second image with a tensor shape :math:`(B, N, 2)`.\n        weights (torch.Tensor): Tensor containing the weights per point correspondence with a shape of :math:`(B, N)`.\n          Used for the first iteration of the IRWLS.\n        soft_inl_th (float): Soft inlier threshold used for weight calculation.\n        n_iter (int): number of iterations. Default is 5.\n\n    Returns:\n        torch.Tensor: the computed homography matrix with shape :math:`(B, 3, 3)`.\n    \"\"\"\n\n    '''Function, which finds homography via iteratively-reweighted\n    least squares ToDo: add citation'''\n    H: torch.Tensor = find_homography_dlt(points1, points2, weights)\n    for i in range(n_iter - 1):\n        pts1_in_2: torch.Tensor = kornia.transform_points(H, points1)\n        error_squared: torch.Tensor = (pts1_in_2 - points2).pow(2).sum(dim=-1)\n        weights_new: torch.Tensor = torch.exp(-error_squared / (2.0 * (soft_inl_th ** 2)))\n        H = find_homography_dlt(points1, points2, weights_new)\n    return H\n", "path": "kornia/geometry/homography.py"}], "after_files": [{"content": "import warnings\n\nimport torch\nfrom typing import Tuple, Optional\n\nimport kornia\nfrom kornia.geometry.epipolar import normalize_points\n\nTupleTensor = Tuple[torch.Tensor, torch.Tensor]\n\n\ndef find_homography_dlt(\n        points1: torch.Tensor, points2: torch.Tensor, weights: Optional[torch.Tensor] = None) -> torch.Tensor:\n    r\"\"\"Computes the homography matrix using the DLT formulation.\n\n    The linear system is solved by using the Weighted Least Squares Solution for the 4 Points algorithm.\n\n    Args:\n        points1 (torch.Tensor): A set of points in the first image with a tensor shape :math:`(B, N, 2)`.\n        points2 (torch.Tensor): A set of points in the second image with a tensor shape :math:`(B, N, 2)`.\n        weights (torch.Tensor, optional): Tensor containing the weights per point correspondence with a shape of\n                :math:`(B, N)`. Defaults to all ones.\n\n    Returns:\n        torch.Tensor: the computed homography matrix with shape :math:`(B, 3, 3)`.\n    \"\"\"\n    assert points1.shape == points2.shape, points1.shape\n    assert len(points1.shape) >= 1 and points1.shape[-1] == 2, points1.shape\n    assert points1.shape[1] >= 4, points1.shape\n\n    eps: float = 1e-8\n    points1_norm, transform1 = normalize_points(points1)\n    points2_norm, transform2 = normalize_points(points2)\n\n    x1, y1 = torch.chunk(points1_norm, dim=-1, chunks=2)  # BxNx1\n    x2, y2 = torch.chunk(points2_norm, dim=-1, chunks=2)  # BxNx1\n    ones, zeros = torch.ones_like(x1), torch.zeros_like(x1)\n\n    # DIAPO 11: https://www.uio.no/studier/emner/matnat/its/nedlagte-emner/UNIK4690/v16/forelesninger/lecture_4_3-estimating-homographies-from-feature-correspondences.pdf  # noqa: E501\n    ax = torch.cat([zeros, zeros, zeros, -x1, -y1, -ones, y2 * x1, y2 * y1, y2], dim=-1)\n    ay = torch.cat([x1, y1, ones, zeros, zeros, zeros, -x2 * x1, -x2 * y1, -x2], dim=-1)\n    A = torch.cat((ax, ay), dim=-1).reshape(ax.shape[0], -1, ax.shape[-1])\n\n    if weights is None:\n        # All points are equally important\n        A = A.transpose(-2, -1) @ A\n    else:\n        # We should use provided weights\n        assert len(weights.shape) == 2 and weights.shape == points1.shape[:2], weights.shape\n        w_diag = torch.diag_embed(weights.unsqueeze(dim=-1).repeat(1, 1, 2).reshape(weights.shape[0], -1))\n        A = A.transpose(-2, -1) @ w_diag @ A\n\n    try:\n        U, S, V = torch.svd(A)\n    except:\n        warnings.warn('SVD did not converge', RuntimeWarning)\n        return torch.empty((points1_norm.size(0), 3, 3), device=points1.device)\n\n    H = V[..., -1].view(-1, 3, 3)\n    H = transform2.inverse() @ (H @ transform1)\n    H_norm = H / (H[..., -1:, -1:] + eps)\n    return H_norm\n\n\ndef find_homography_dlt_iterated(points1: torch.Tensor,\n                                 points2: torch.Tensor,\n                                 weights: torch.Tensor,\n                                 soft_inl_th: float = 3.0,\n                                 n_iter: int = 5) -> torch.Tensor:\n    r\"\"\"Computes the homography matrix using the iteratively-reweighted least squares (IRWLS).\n\n    The linear system is solved by using the Reweighted Least Squares Solution for the 4 Points algorithm.\n\n    Args:\n        points1 (torch.Tensor): A set of points in the first image with a tensor shape :math:`(B, N, 2)`.\n        points2 (torch.Tensor): A set of points in the second image with a tensor shape :math:`(B, N, 2)`.\n        weights (torch.Tensor): Tensor containing the weights per point correspondence with a shape of :math:`(B, N)`.\n          Used for the first iteration of the IRWLS.\n        soft_inl_th (float): Soft inlier threshold used for weight calculation.\n        n_iter (int): number of iterations. Default is 5.\n\n    Returns:\n        torch.Tensor: the computed homography matrix with shape :math:`(B, 3, 3)`.\n    \"\"\"\n\n    '''Function, which finds homography via iteratively-reweighted\n    least squares ToDo: add citation'''\n    H: torch.Tensor = find_homography_dlt(points1, points2, weights)\n    for i in range(n_iter - 1):\n        pts1_in_2: torch.Tensor = kornia.transform_points(H, points1)\n        error_squared: torch.Tensor = (pts1_in_2 - points2).pow(2).sum(dim=-1)\n        weights_new: torch.Tensor = torch.exp(-error_squared / (2.0 * (soft_inl_th ** 2)))\n        H = find_homography_dlt(points1, points2, weights_new)\n    return H\n", "path": "kornia/geometry/homography.py"}]}