code: def test_piecewise_linear_op(self, binary_input):
      if binary_input:
          num_dims = 1
      else:
          num_dims = 3
      data = np.random.rand(1024, num_dims).astype(np.float32)
      slopes = np.zeros(4 * num_dims).astype(np.float32)
      bounds = np.sort(
          np.random.rand(5, num_dims).astype(np.float32), axis=0
      ).flatten("F")
      intercepts = np.random.rand(4 * num_dims).astype(np.float32)
  
      def _piecewise_linear_ref(X):
          ref_op = core.CreateOperator(
              "PiecewiseLinearTransform",
              ["data", "bounds", "slopes", "intercepts"],
              ["calibrated"],
              binary=binary_input,
          )
          workspace.FeedBlob("data", X)
          workspace.FeedBlob("bounds", bounds)
          workspace.FeedBlob("slopes", slopes)
          workspace.FeedBlob("intercepts", intercepts)
          workspace.RunOperatorOnce(ref_op)
          return workspace.FetchBlob("calibrated")
  
      expected_output = _piecewise_linear_ref(data)
      actual_output = torch.ops._caffe2.PiecewiseLinearTransform(
          torch.tensor(data),
          bounds.tolist(),
          slopes.tolist(),
          intercepts.tolist(),
          binary_input,
      )
  
      assert_allclose(torch.tensor(expected_output), actual_output)
  
imports: import struct
  import unittest
  import caffe2.python.hypothesis_test_util
  import hypothesis.strategies
  import numpy
  import torch
  from caffe2.python import core, workspace
  from hypothesis import given, settings
  from scipy.stats import norm
  from ._utils import assert_allclose
label_desc: Use image node_id 31 for calling the TorchIntegration obj's underlying member method code with example usage: obj.test_piecewise_linear_op(binary_input) and returns: workspace