docstr: Args:
      name:
          A string identifier for the generated Tensor.
      size:
          A tuple of integers or strings specifying the size of the generated
          Tensor. String values will replaced with a concrete int during the
          generation process, while ints are simply passed as literals.
      steps:
          An optional tuple with the same length as `size`. This indicates
          that a larger Tensor should be allocated, and then sliced to
          produce the generated Tensor. For instance, if size is (4, 8)
          and steps is (1, 4), then a tensor `t` of size (4, 32) will be
          created and then `t[:, ::4]` will be used. (Allowing one to test
          Tensors with strided memory.)
      probability_contiguous:
          A number between zero and one representing the chance that the
          generated Tensor has a contiguous memory layout. This is achieved by
          randomly permuting the shape of a Tensor, calling `.contiguous()`,
          and then permuting back. This is applied before `steps`, which can
          also cause a Tensor to be non-contiguous.
      min_elements:
          The minimum number of parameters that this Tensor must have for a
          set of parameters to be valid. (Otherwise they are resampled.)
      max_elements:
          Like `min_elements`, but setting an upper bound.
      max_allocation_bytes:
          Like `max_elements`, but for the size of Tensor that must be
          allocated prior to slicing for `steps` (if applicable). For
          example, a FloatTensor with size (1024, 1024) and steps (4, 4)
          would have 1M elements, but would require a 64 MB allocation.
      dim_parameter:
          The length of `size` and `steps` will be truncated to this value.
          This allows Tensors of varying dimensions to be generated by the
          Fuzzer.
      dtype:
          The PyTorch dtype of the generated Tensor.
      cuda:
          Whether to place the Tensor on a GPU.
      tensor_constructor:
          Callable which will be used instead of the default Tensor
          construction method. This allows the author to enforce properties
          of the Tensor (e.g. it can only have certain values). The dtype and
          concrete shape of the Tensor to be created will be passed, and
          concrete values of all parameters will be passed as kwargs. Note
          that transformations to the result (permuting, slicing) will be
          performed by the Fuzzer; the tensor_constructor is only responsible
          for creating an appropriately sized Tensor.
docstr_tok: ["Args",":","name",":","A","string","identifier","for","the","generated","Tensor",".","size",":","A","tuple","of","integers","or","strings","specifying","the","size","of","the","generated","Tensor",".","String","values","will","replaced","with","a","concrete","int","during","the","generation","process",",","while","ints","are","simply","passed","as","literals",".","steps",":","An","optional","tuple","with","the","same","length","as","`","size","`",".","This","indicates","that","a","larger","Tensor","should","be","allocated",",","and","then","sliced","to","produce","the","generated","Tensor",".","For","instance",",","if","size","is","(","4",",","8",")","and","steps","is","(","1",",","4",")",",","then","a","tensor","`","t","`","of","size","(","4",",","32",")","will","be","created","and","then","`","t","[",":",",",":",":4","]","`","will","be","used",".","(","Allowing","one","to","test","Tensors","with","strided","memory",".",")","probability_contiguous",":","A","number","between","zero","and","one","representing","the","chance","that","the","generated","Tensor","has","a","contiguous","memory","layout",".","This","is","achieved","by","randomly","permuting","the","shape","of","a","Tensor",",","calling","`",".contiguous","(",")","`",",","and","then","permuting","back",".","This","is","applied","before","`","steps","`",",","which","can","also","cause","a","Tensor","to","be","non-contiguous",".","min_elements",":","The","minimum","number","of","parameters","that","this","Tensor","must","have","for","a","set","of","parameters","to","be","valid",".","(","Otherwise","they","are","resampled",".",")","max_elements",":","Like","`","min_elements","`",",","but","setting","an","upper","bound",".","max_allocation_bytes",":","Like","`","max_elements","`",",","but","for","the","size","of","Tensor","that","must","be","allocated","prior","to","slicing","for","`","steps","`","(","if","applicable",")",".","For","example",",","a","FloatTensor","with","size","(","1024",",","1024",")","and","steps","(","4",",","4",")","would","have","1M","elements",",","but","would","require","a","64","MB","allocation",".","dim_parameter",":","The","length","of","`","size","`","and","`","steps","`","will","be","truncated","to","this","value",".","This","allows","Tensors","of","varying","dimensions","to","be","generated","by","the","Fuzzer",".","dtype",":","The","PyTorch","dtype","of","the","generated","Tensor",".","cuda",":","Whether","to","place","the","Tensor","on","a","GPU",".","tensor_constructor",":","Callable","which","will","be","used","instead","of","the","default","Tensor","construction","method",".","This","allows","the","author","to","enforce","properties","of","the","Tensor","(","e.g",".","it","can","only","have","certain","values",")",".","The","dtype","and","concrete","shape","of","the","Tensor","to","be","created","will","be","passed",",","and","concrete","values","of","all","parameters","will","be","passed","as","kwargs",".","Note","that","transformations","to","the","result","(","permuting",",","slicing",")","will","be","performed","by","the","Fuzzer",";","the","tensor_constructor","is","only","responsible","for","creating","an","appropriately","sized","Tensor","."]
code: def __init__(
      self,
      name: str,
      size: Tuple[Union[str, int], ...],
      steps: Optional[Tuple[Union[str, int], ...]] = None,
      probability_contiguous: float = 0.5,
      min_elements: Optional[int] = None,
      max_elements: Optional[int] = None,
      max_allocation_bytes: Optional[int] = None,
      dim_parameter: Optional[str] = None,
      roll_parameter: Optional[str] = None,
      dtype=torch.float32,
      cuda=False,
      tensor_constructor: Optional[Callable] = None,
  ):
      """
      Args:
          name:
              A string identifier for the generated Tensor.
          size:
              A tuple of integers or strings specifying the size of the generated
              Tensor. String values will replaced with a concrete int during the
              generation process, while ints are simply passed as literals.
          steps:
              An optional tuple with the same length as `size`. This indicates
              that a larger Tensor should be allocated, and then sliced to
              produce the generated Tensor. For instance, if size is (4, 8)
              and steps is (1, 4), then a tensor `t` of size (4, 32) will be
              created and then `t[:, ::4]` will be used. (Allowing one to test
              Tensors with strided memory.)
          probability_contiguous:
              A number between zero and one representing the chance that the
              generated Tensor has a contiguous memory layout. This is achieved by
              randomly permuting the shape of a Tensor, calling `.contiguous()`,
              and then permuting back. This is applied before `steps`, which can
              also cause a Tensor to be non-contiguous.
          min_elements:
              The minimum number of parameters that this Tensor must have for a
              set of parameters to be valid. (Otherwise they are resampled.)
          max_elements:
              Like `min_elements`, but setting an upper bound.
          max_allocation_bytes:
              Like `max_elements`, but for the size of Tensor that must be
              allocated prior to slicing for `steps` (if applicable). For
              example, a FloatTensor with size (1024, 1024) and steps (4, 4)
              would have 1M elements, but would require a 64 MB allocation.
          dim_parameter:
              The length of `size` and `steps` will be truncated to this value.
              This allows Tensors of varying dimensions to be generated by the
              Fuzzer.
          dtype:
              The PyTorch dtype of the generated Tensor.
          cuda:
              Whether to place the Tensor on a GPU.
          tensor_constructor:
              Callable which will be used instead of the default Tensor
              construction method. This allows the author to enforce properties
              of the Tensor (e.g. it can only have certain values). The dtype and
              concrete shape of the Tensor to be created will be passed, and
              concrete values of all parameters will be passed as kwargs. Note
              that transformations to the result (permuting, slicing) will be
              performed by the Fuzzer; the tensor_constructor is only responsible
              for creating an appropriately sized Tensor.
      """
      self._name = name
      self._size = size
      self._steps = steps
      self._probability_contiguous = probability_contiguous
      self._min_elements = min_elements
      self._max_elements = max_elements
      self._max_allocation_bytes = max_allocation_bytes
      self._dim_parameter = dim_parameter
      self._dtype = dtype
      self._cuda = cuda
      self._tensor_constructor = tensor_constructor
  
imports: import functools
  import itertools
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
label_desc: Use image node_id 1 to create a new FuzzedTensor object  with example: obj = FuzzedTensor(name, size, steps, probability_contiguous, min_elements, max_elements, max_allocation_bytes, dim_parameter, roll_parameter, dtype, cuda, tensor_constructor)