We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[tensor] fix some unittests

[tensor] fix some unittests

[tensor] fix some unittests


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `colossalai/legacy/tensor/tensor_spec.py`
Content:
```
1 from dataclasses import dataclass
2 from typing import Optional
3 
4 from colossalai.legacy.tensor.distspec import DistPlacementPattern, _DistSpec
5 from colossalai.legacy.tensor.process_group import ProcessGroup
6 
7 from .compute_spec import ComputeSpec
8 
9 
10 @dataclass
11 class ColoTensorSpec:
12     """ColoTensorSpec
13 
14     A data class for specifications of the `ColoTensor`.
15     It contains attributes of `ProcessGroup`, `_DistSpec`, `ComputeSpec`.
16     The latter two attributes are optional. If not set, they are default value is `Replicate()` and `None`.
17     """
18 
19     pg: ProcessGroup
20     dist_attr: Optional[_DistSpec] = _DistSpec(DistPlacementPattern.REPLICATE)
21     compute_attr: Optional[ComputeSpec] = None
22
```
--- 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/colossalai/legacy/tensor/tensor_spec.py b/colossalai/legacy/tensor/tensor_spec.py
--- a/colossalai/legacy/tensor/tensor_spec.py
+++ b/colossalai/legacy/tensor/tensor_spec.py
@@ -1,4 +1,4 @@
-from dataclasses import dataclass
+from dataclasses import dataclass, field
 from typing import Optional
 
 from colossalai.legacy.tensor.distspec import DistPlacementPattern, _DistSpec
@@ -17,5 +17,5 @@
     """
 
     pg: ProcessGroup
-    dist_attr: Optional[_DistSpec] = _DistSpec(DistPlacementPattern.REPLICATE)
+    dist_attr: Optional[_DistSpec] = field(default_factory=lambda: _DistSpec(DistPlacementPattern.REPLICATE))
     compute_attr: Optional[ComputeSpec] = None

{"golden_diff": "diff --git a/colossalai/legacy/tensor/tensor_spec.py b/colossalai/legacy/tensor/tensor_spec.py\n--- a/colossalai/legacy/tensor/tensor_spec.py\n+++ b/colossalai/legacy/tensor/tensor_spec.py\n@@ -1,4 +1,4 @@\n-from dataclasses import dataclass\n+from dataclasses import dataclass, field\n from typing import Optional\n \n from colossalai.legacy.tensor.distspec import DistPlacementPattern, _DistSpec\n@@ -17,5 +17,5 @@\n     \"\"\"\n \n     pg: ProcessGroup\n-    dist_attr: Optional[_DistSpec] = _DistSpec(DistPlacementPattern.REPLICATE)\n+    dist_attr: Optional[_DistSpec] = field(default_factory=lambda: _DistSpec(DistPlacementPattern.REPLICATE))\n     compute_attr: Optional[ComputeSpec] = None\n", "issue": "[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n", "before_files": [{"content": "from dataclasses import dataclass\nfrom typing import Optional\n\nfrom colossalai.legacy.tensor.distspec import DistPlacementPattern, _DistSpec\nfrom colossalai.legacy.tensor.process_group import ProcessGroup\n\nfrom .compute_spec import ComputeSpec\n\n\n@dataclass\nclass ColoTensorSpec:\n    \"\"\"ColoTensorSpec\n\n    A data class for specifications of the `ColoTensor`.\n    It contains attributes of `ProcessGroup`, `_DistSpec`, `ComputeSpec`.\n    The latter two attributes are optional. If not set, they are default value is `Replicate()` and `None`.\n    \"\"\"\n\n    pg: ProcessGroup\n    dist_attr: Optional[_DistSpec] = _DistSpec(DistPlacementPattern.REPLICATE)\n    compute_attr: Optional[ComputeSpec] = None\n", "path": "colossalai/legacy/tensor/tensor_spec.py"}], "after_files": [{"content": "from dataclasses import dataclass, field\nfrom typing import Optional\n\nfrom colossalai.legacy.tensor.distspec import DistPlacementPattern, _DistSpec\nfrom colossalai.legacy.tensor.process_group import ProcessGroup\n\nfrom .compute_spec import ComputeSpec\n\n\n@dataclass\nclass ColoTensorSpec:\n    \"\"\"ColoTensorSpec\n\n    A data class for specifications of the `ColoTensor`.\n    It contains attributes of `ProcessGroup`, `_DistSpec`, `ComputeSpec`.\n    The latter two attributes are optional. If not set, they are default value is `Replicate()` and `None`.\n    \"\"\"\n\n    pg: ProcessGroup\n    dist_attr: Optional[_DistSpec] = field(default_factory=lambda: _DistSpec(DistPlacementPattern.REPLICATE))\n    compute_attr: Optional[ComputeSpec] = None\n", "path": "colossalai/legacy/tensor/tensor_spec.py"}]}