code: def replica_only_strategy(
      mesh: DeviceMesh, op_schema: OpSchema
  ) -> StrategyType:
      """Only allow replication on the input/ouput."""
      replicate_spec = DTensorSpec(
          mesh, tuple([Replicate()] * mesh.ndim)
      )
      return OpStrategy([PlacementStrategy(replicate_spec)])
  
imports: from typing import cast, List, Optional, Sequence, Tuple
  import torch
  from torch.distributed._tensor._utils import compute_local_shape
  from torch.distributed._tensor.op_schema import OpSchema, OpStrategy, OutputSharding, PlacementStrategy, RuntimeSchemaInfo, StrategyType
  from torch.distributed._tensor.ops.common_rules import pointwise_rule
  from torch.distributed._tensor.ops.utils import is_tensor_dim_sharded, is_tensor_partial, normalize_dim, prod, register_op_strategy, register_prop_rule
  from torch.distributed._tensor.placement_types import _Partial, DTensorSpec, Placement, Replicate, Shard
  from torch.distributed.device_mesh import DeviceMesh
label_desc: Use image node_id 10 for calling a global function with example usage: replica_only_strategy(mesh, op_schema) and returns: OpStrategy